A, B = list(map(int, input().split()))

S = eval(input())



for i in range(len(S)):

  if i != A and S[i] == '-':

    print('No')

    exit()

  if i == A and S[i] != '-':

    print('No')

    exit()



print('Yes')
A, B = list(map(int, input().split()))

S = eval(input())



for i in range(len(S)):

  if (i != A and S[i] == '-') or (i == A and S[i] != '-'):

    print('No')

    exit()

    

print('Yes')
A, B = list(map(int, input().split()))
S = eval(input())
for i in range(len(S)):
    if i != A and S[i] == "-":
        print("No")
        exit()
    if i == A and S[i] != "-":
        print("No")
        exit()
print("Yes")

A, B = list(map(int, input().split()))
S = eval(input())
for i in range(len(S)):
    if (i != A and S[i] == "-") or (i == A and S[i] != "-"):
        print("No")
        exit()
print("Yes")

-    if i != A and S[i] == "-": -        print("No") -        exit() -    if i == A and S[i] != "-": +    if (i != A and S[i] == "-") or (i == A and S[i] != "-"):