#include <bits/stdc++.h>
#define loop(i,s,e) for(int i=s; i<e; i++)
using namespace std;
int solve() {
    int n; cin>>n;
    string s; cin>>s;
    bool ok = 1;
    int cnt = 0;
    loop(i,0,n) if(s[i]=='W') cnt++;
    if (cnt % 2 == 1) ok = 0;
    else {
        loop(i,0,cnt/2) if(s[i]!='W') ok = 0;
        loop(i,0,cnt/2) if(s[2*n-i-1]!='R') ok = 0;
    }
    cout << (!ok ? "NO" : "YES") << endl;
    return 0;
}
int main() {
    ios_base::sync_with_stdio(false);
    int t; cin>>t;
    for(int i=0; i<t; i++) {
        solve();
    }
    return 0;
}