#include <bits/stdc++.h>

using namespace std;

void solve(){
    int n; cin >> n;
    string s; cin >> s;
    int cw = 0, fr = 500;
    for (int i = 0; i < n; i++)
    {
        cw += s[i] == 'W';
        if(s[i] == 'R'){
            fr = min(fr, i);
        }
    }
    
    if(cw % 2 == 0 and cw / 2 <= fr){
        cout << "YES\n";
    }else{
        cout << "NO\n";
    }
}

int main(){
    int t; cin >> t;
    while(t--) solve();
}