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

S = eval(input())

D = [ str(i) for i in range(10)]

T = S[:A] + S[A+1:]



if S[A] == "-" and all( t in D for t in T):

  print("Yes")

else:

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

S = eval(input())



if S.find("-") == S.rfind("-") == A:

  print("Yes")

else:

  print("No")
A, B = list(map(int, input().split()))
S = eval(input())
D = [str(i) for i in range(10)]
T = S[:A] + S[A + 1 :]
if S[A] == "-" and all(t in D for t in T):
    print("Yes")
else:
    print("No")

A, B = list(map(int, input().split()))
S = eval(input())
if S.find("-") == S.rfind("-") == A:
    print("Yes")
else:
    print("No")

-D = [str(i) for i in range(10)] -T = S[:A] + S[A + 1 :] -if S[A] == "-" and all(t in D for t in T): +if S.find("-") == S.rfind("-") == A: