?
for _ in range(int(input())): n = int(input()) a = map(int, input().split()) b = list(input()) c = sorted(zip(b, a)) for i, (x, y) in enumerate(c): if x == 'B' and y < (i + 1) or x == 'R' and y > (i + 1): print('NO') break else: print('YES')
?
?
?
?