for _ in range(int(input())):
    n = int(input())

    s = input()
    a = s[:n].count('W')
    if a == 0:
        print("YES")
        continue
    print("YES" if a % 2 == 0 and s[:a//2] == "W"*(a//2) and s[-a//2:] == "R"*(a//2) else "NO")