import sys input = sys.stdin.readline for _ in range(int(input())): n = int(input()) s = input().strip() w = [i for i in range(n) if s[i] == 'R'] r = [i for i in range(n, 2 * n) if s[i] == 'W'] a = [0] * (n * 2) for i in w + r: a[i] = 1 l = [s[i] for i in range(2 * n) if a[i] == 0] if all(l[i] == l[i + 1] for i in range(0, len(l), 2)): print('YES') else: print('NO')