t = int(input())

n, m = map(int, input().split())
a = list(map(int, input().split()))
s = input()
g = [0] * 4
for i in range(n):
    if s[i] == "R":
        g[int(a[i] % 2)] += 1
    else:
        g[2+int(a[i] % 2)] += 1
if g[0] == 1 and g[1] == 1:
    print("No")
    exit(0)
if g[2] == 1 and g[3] == 1:
    print("No")
    exit(0)
print("Yes")