#pragma GCC optimize("O3")
#include <bits/stdc++.h>

//#define int long long

using namespace std;

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x),end(x)
#define sz(x) (int)(x).size()
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(0);

	int t;
	cin >> t;
	while(t--){
		int n;
		cin >> n;
		char W = 'W', R = 'R';
		string s;
		cin >> s;
		deque<int> first, second;
		for(int i = 0; i < n; i++){
			if(s[i] == R){
				first.pb(i);
			}
		}
		for(int i = n; i < 2 * n; i++){
			if(s[i] == W){
				second.pb(i);
			}
		}
		{
			vector<int> Ws;
			for(int i = 0; i < n; i++){
				if(s[i] == W) Ws.pb(i);
			}
			if((sz(Ws) % 2) != 0){
				cout << "NO\n";
			   	continue;
			}
			for(int i = sz(Ws) / 2 - 1; i >= 0; i--){
				first.push_front(Ws[i]);
			}
			for(int i = sz(Ws) - 1; i >= sz(Ws) / 2; i--){
				second.push_front(Ws[i]);
			}
		}
		{
			vector<int> Rs;
			for(int i = n; i < 2 * n; i++){
				if(s[i] == R) Rs.pb(i);
			}
			if((sz(Rs) % 2) != 0) {
				cout << "NO\n";
				continue;
			}
			for(int i = 0; i < sz(Rs) / 2; i++){
				first.pb(Rs[i]);
			}
			for(int i = sz(Rs) / 2; i < sz(Rs); i++){
				second.pb(Rs[i]);
			}
		}

		string tst = s;
		assert(sz(first) == sz(second));
		assert(sz(first) == n);
		sort(first.begin(), first.end());
		sort(second.begin(), second.end());
		for(int i = 0; i < n; i++){
			swap(tst[first[i]], tst[second[i]]);
		}
		bool pos = true;
		for(int i = 0; i < n; i++){
			if(tst[i] != W) pos = false;
		}
		for(int i = n; i < 2 * n; i++){
			if(tst[i] != R) pos = false;
		}
		if(pos) cout << "YES\n";
		else cout << "NO\n";
	}
	
	return 0;
}