#include <bits/stdc++.h>
using namespace std;

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

    int cntr = 0, cntw = 0;
    int jw = 0, jr = 0;
    for(int i = 0; i < n; i++){
        if(s[i] == 'W') cntw++;
    }

    while(jw < n && s[jw] == 'W') ++jw;

    for(int i = n; i < n*2; i++) {
        if(s[i] == 'R') cntr++;
    }

    while(jr < n && s[2*n - jr - 1] == 'R') ++jr;

    if(cntw % 2 == 0 && jw * 2 >= cntw && cntr % 2 == 0 && jr * 2 >= cntr) {
        cout << "YES\n";
    } else {
        cout << "NO\n";
    }
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int t;
    cin>>t;
    while(t--) solve();
    return 0;
}