#include <bits/stdc++.h> using namespace std; void solve() { string s; int n; cin >> n; cin >> s; int cnt = 0, pf = 0; for (int i = 0; i < n; ++i) { if (s[i] == 'W') { ++pf; } else { break; } } for (int i = 0; i < n; ++i) { if (s[i] == 'W') { ++cnt; } } if (cnt % 2 == 0 && pf * 2 >= cnt) cout << "YES\n"; else cout << "NO\n"; } int main() { cin.tie(NULL); ios::sync_with_stdio(false); int t; cin >> t; while (t--) solve(); return 0; }