#include <bits/stdc++.h>

#define all(x) x.begin(), x.end()
#define len(x) (int)(x.size())
#define mp make_pair
#define pb push_back
#define fi first
#define se second

using namespace std;

typedef pair<int, int> pii;
typedef long long ll;
typedef long double ld;

bool umin(int& a, int b) {
    if(b < a) {
        a = b;
        return true;
    }
    return false;
}

bool umax(int& a, int b) {
    if(b > a) {
        a = b;
        return true;
    }
    return false;
}

#ifdef KoRoVa
#define DEBUG for (bool __DEBUG=1;__DEBUG;__DEBUG=0)
#define LOG(...) prnt(#__VA_ARGS__" ::",_VA_ARGS)<<endl
#else
#define DEBUG while(false)
#define LOG(...) if(false)
#endif

template <class ...Ts> auto &prnt(Ts ...ts) {
    return ((cerr << ts << " "), ...);
}

const int max_n = -1, inf = 1000111222;

const ll linf = 1000111222000111222;

void test_case() {
    int n;
    cin>>n;
    string s;
    cin>>s;
    int cntW = 0, cntR = 0;
    for(int i = 0; i < n; i++)
        if(s[i] == 'W')
            cntW++;
    int cnt = 0;
    for(int i = 0; i < n; i++)
    {
        if(s[i] == 'W')
            cnt++;
        else
            break;
    }
    for(int i = 0; i < n; i++)
    {
        if(s[2 * n - i - 1] == 'R')
            cntR++;
        else
            break;
    }
    if(cnt * 2 < cntW || cntW%2|| cntR * 2 < cntW)
    {
        cout<<"NO\n";
        return;
    }
//    int j = n;
//    for(int i = 0; i < n; i++)
//    {
//        if(s[i] == 'W')
//        {
//            continue;
//        }
//        while(j < 2 * n && s[j] == 'R')
//                j++;
//        if(j == 2 * n)
//        {
//            cout<<"NO\n";
//            return;
//        }
//        j++;
//    }
    cout<<"YES\n";
}

signed main() {

//    freopen("input.txt", "r", stdin);

    ios_base::sync_with_stdio(false);

    cin.tie(nullptr);

    int testcases = 1;

    cin >> testcases;

    while(testcases--) test_case();

    exit(0);
}

/*
 * 3
4
5
YES
2
NO
1
3
20
23
24
25
26
27
28
29
31
32
34
35
40
 */