#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep2(i, n, m) for (int i = (n); i < (m); i++) #define rep(i, n) rep2(i, 0, n) void ints(auto& ...ints) { (scanf("%d", &ints), ...); } int n; char S[205]; int W[205], R[205]; bool check() { scanf("%d%s", &n, S); fill(W, W+n*2+1, 0); fill(R, R+n*2+1, 0); rep(i, n*2) (S[i] == 'W' ? W[i+1] : R[i])++; rep(i, n*2) W[i+1] += W[i]; for (int i = n*2; i--;) R[i] += R[i+1]; int k = W[n]; if (k % 2) return false; rep(i, n) if (W[i] < k/2 && S[i] != 'W') return false; if (n - W[n] != n - R[n]) return false; rep2(i, n, n*2) if (R[i+1] < k/2 && S[i] != 'R') return false; return true; } int main() { int t; ints(t); while (t--) { bool ans = check(); printf("%s\n", ans ? "YES" : "NO"); } }