#include<bits/stdc++.h> using namespace std; void solve() { int n; cin >> n; string s; cin >> s; int i = 0; while(s[i] == 'W') i++; int st = i; int af = 0; for(;i < n; i++) if (s[i] == 'W') af++; if (st >= af && (st+af) % 2 == 0) cout << "YES\n"; else cout << "NO\n"; } int main() { int t; cin >> t; while(t--) { solve(); } }