#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; #define int int64_t #define loop(i,s,t) for(int i=s;i<t;i++) #define loopr(i,s,t) for(int i=t-1;i>=s;i--) #define all(a) a.begin(),a.end() typedef pair<int, int> ii; typedef vector<ii> vii; typedef long double ld; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); int t; cin >> t; while(t--){ bool good = true; int n; cin >> n; string s; cin >> s; set<int> taken; int first_half_w = 0; int pre_w = 0; bool seen_r = false; int second_half_w = 0; int suf_r = 0; bool seen_w = 0; loop(i, 0, n){ if(s[i] == 'W'){ first_half_w++; if(!seen_r){ pre_w++; } } else{ seen_r = true; } } loopr(i, n, 2*n){ if(s[i] == 'R'){ second_half_w++; if(!seen_w){ suf_r++; } } else{ seen_w = true; } } if(pre_w * 2 >= first_half_w && suf_r * 2 >= second_half_w && first_half_w % 2 == 0 && second_half_w % 2 == 0){ cout << "YES" << endl; } else { cout << "NO" << endl; } } return 0; }