#include <bits/stdc++.h> using namespace std; void solve(){ int n; cin >> n; string s; cin >> s; vector<int> posW, posR; for(int i=0; i<2*n; i++){ if(s[i] == 'W'){ posW.push_back(i); } else posR.push_back(i); } int cnt = 0; for(int e : posW){ if(e<n)cnt++; } if(cnt&1){ cout << "NO\n"; } else{ if(cnt == 0 || posW[cnt/2-1] == cnt/2-1){ cout << "YES\n"; } else cout << "NO\n"; } } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int t; cin >> t; while(t--){ solve(); } }