#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll,ll> ii; typedef vector<ll> vi; typedef vector<ii> vii; typedef vector<vi> vvi; #define x first #define y second #define pb push_back #define eb emplace_back #define rep(i,a,b) for(auto i = (a); i < (b); ++i) #define REP(i,n) rep(i,0,n) #define sz(v) ((int) (v).size()) #define rs resize #define all(v) begin(v), end(v) int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout << fixed << setprecision(20); ll t; for(cin >> t; t > 0; t--){ ll n; cin >> n; string s; cin >> s; ll k = 0; for(ll i = 0; i < n; i++) if(s[i] == 'W') k++; if(k%2 == 1){ cout << "NO" <<endl; continue; } k/=2; bool klopt = true; for(ll i = 0; i < k; i++) if(s[i] != 'W' || s[2 * n - 1 - i] != 'R'){ klopt = false; break; } if(klopt) cout << "YES" << endl; else cout << "NO" <<endl; } return 0; }