a,b = list(map(int,input().split()))

s=eval(input())



for i in range(a+b+1):

    if i < a and '-' != s[i]:

        continue

    elif  a < i and i < a+b+1 and '-' != s[i]:

        continue

    elif i == a and '-' == s[i]:

        continue

    else:

        print('No')

        exit()

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

S = list(eval(input()))

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



okFlag = True

for key,val in enumerate(S):

    if key == A:

        if S[key] != '-':

            okFlag = False

        else:

            continue

    elif S[key] not in check:

        okFlag = False



if okFlag:

    print('Yes')

else:

    print('No')
a, b = list(map(int, input().split()))
s = eval(input())
for i in range(a + b + 1):
    if i < a and "-" != s[i]:
        continue
    elif a < i and i < a + b + 1 and "-" != s[i]:
        continue
    elif i == a and "-" == s[i]:
        continue
    else:
        print("No")
        exit()
print("Yes")

A, B = list(map(int, input().split()))
S = list(eval(input()))
check = [str(i) for i in range(10)]
okFlag = True
for key, val in enumerate(S):
    if key == A:
        if S[key] != "-":
            okFlag = False
        else:
            continue
    elif S[key] not in check:
        okFlag = False
if okFlag:
    print("Yes")
else:
    print("No")

-a, b = list(map(int, input().split())) -s = eval(input()) -for i in range(a + b + 1): -    if i < a and "-" != s[i]: -        continue -    elif a < i and i < a + b + 1 and "-" != s[i]: -        continue -    elif i == a and "-" == s[i]: -        continue -    else: -        print("No") -        exit() -print("Yes") +A, B = list(map(int, input().split())) +S = list(eval(input())) +check = [str(i) for i in range(10)] +okFlag = True +for key, val in enumerate(S): +    if key == A: +        if S[key] != "-": +            okFlag = False +        else: +            continue +    elif S[key] not in check: +        okFlag = False +if okFlag: +    print("Yes") +else: +    print("No")