#include <bits/stdc++.h>
using namespace std;

bool solve() {
    int n; cin >> n;
    string s; cin >> s;

    int w = 0;

    for (int i = 0; i < n; i++) {
        if (s[i] == 'W') w++;
    }
    if (w % 2 == 1) return false;
    else {
        for (int i = 0; i < w / 2; i++) {
            if (s[i] != 'W') return false;
        }
    }
    return true;
}

int main() {
    cin.tie(0)->sync_with_stdio(0);

    int tt; cin >> tt;
    while (tt--) {
        bool ans = solve();
        cout << (ans ? "YES\n" : "NO\n");
    }


    return 0;
}