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

S = eval(input())

NUM = list(range(10))

X = 0

while X != A+B+1:

    if X == A:

        if S[X] != "-":

            print("No")

            quit()

        X += 1

    else:

        if S[X] == "-":

            print("No")

            quit()

        if int(S[X]) in NUM:

            X += 1

        else:

            print("No")

            quit()

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

s = eval(input())



if s[a] == '-' and s[:a].isdigit() and s[a+1:].isdigit():

    print('Yes')

else:

    print('No')

#GOFORIT
A, B = list(map(int, input().split()))
S = eval(input())
NUM = list(range(10))
X = 0
while X != A + B + 1:
    if X == A:
        if S[X] != "-":
            print("No")
            quit()
        X += 1
    else:
        if S[X] == "-":
            print("No")
            quit()
        if int(S[X]) in NUM:
            X += 1
        else:
            print("No")
            quit()
print("Yes")

a, b = list(map(int, input().split()))
s = eval(input())
if s[a] == "-" and s[:a].isdigit() and s[a + 1 :].isdigit():
    print("Yes")
else:
    print("No")
# GOFORIT

-A, B = list(map(int, input().split())) -S = eval(input()) -NUM = list(range(10)) -X = 0 -while X != A + B + 1: -    if X == A: -        if S[X] != "-": -            print("No") -            quit() -        X += 1 -    else: -        if S[X] == "-": -            print("No") -            quit() -        if int(S[X]) in NUM: -            X += 1 -        else: -            print("No") -            quit() -print("Yes") +a, b = list(map(int, input().split())) +s = eval(input()) +if s[a] == "-" and s[:a].isdigit() and s[a + 1 :].isdigit(): +    print("Yes") +else: +    print("No") +# GOFORIT