#include <bits/stdc++.h>

using namespace std;

void solve() {
    int n;
    cin >> n;

    string s;
    cin >> s;

    int first_ws = n;
    int wc = 0;
    int rc = 0;
    for(int i = 0; i < n; ++ i) {
        if(s[i] == 'W') {
            ++ wc;
        } else {
            ++ rc;
            if(first_ws == n) {
                first_ws = i;
            }
        }
    }
    
    if(wc % 2 != 0 || wc / 2 > first_ws) {
        // Can't swap in the first half
        cout << "NO\n";
        return;
    }

    // Can we get enough whites from the second half?
    int rc1 = 0;
    int last_rs = 0;
    bool h = true;
    for(int i = n - 1; i >= n; -- i) {
        if(s[i] == 'R') {
            ++ rc1;
            if(h) ++ last_rs;
        } else {
            h = false;
        }
    }
    if(rc1 % 2 != 0 || rc1 / 2 > last_rs) {
        // Can't swap in the second half
        cout << "NO\n";
        return;
    }

    cout << "YES\n";
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

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