#include<bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define ll long long
#define all(a) a.begin(),a.end()
#define endl '\n'

using namespace std;

const int N = 3e5 + 3;

int n, m, x, y;
string s;



void solve() {
    cin >> n;
    cin >> s;
    int cntW = 0;
    int cntR = 0;
    for(int i = 0; i < n; ++i) {
        cntW += s[i] == 'W';
        cntR += s[i + n] == 'R';
    }

    cntW /= 2;
    cntR /= 2;

    vector<int> a1;
    vector<int> a2;
    bool used[2000];
    for(int i = 0; i < n * 2; ++i) used[i] = false;

    for(int i = 0; i < n; ++i) {
        if(s[i] == 'W' && cntW > 0) {
            cntW--;
            used[i] = true;
        }
        if(s[i] == 'R') {
            used[i] = true;
        }
    }

    for(int i = n; i < n * 2; ++i) {
        if(s[i] == 'R' && cntR > 0) {
            cntR--;
            used[i] = true;
        }
    }

    for(int i = 0; i < 2 * n; ++i) {
        if(used[i]) {
            a1.pb(i);
        } else {
            a2.pb(i);
        }
    }

    if(a1.size() != a2.size() || a1.size() != n) {
        cout << "NO" << endl;
        return;
    }

    for(int i = 0; i < n; ++i) {
        swap(s[a1[i]], s[a2[i]]);
    }

    bool f = true;
    for(int i = 0; i < n; ++i) {
        if(s[i] != 'W') {
            f = false;
        }
    }
    if(f) cout << "YES" << endl;
    else cout << "NO" << endl;

}

main() {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t;
    cin >> t;
    while(t--) {
        solve();
    }
}