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

S = eval(input())

nums = ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")

isvalid = all(c in nums for c in S[:A] + S[-B:]) and S[A] == "-"

print(("Yes" if isvalid else "No"))

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

S = eval(input())

isvalid = all("0" <= c <= "9" for c in S[:A] + S[-B:]) and S[A] == "-"

print(("Yes" if isvalid else "No"))

A, B = list(map(int, input().split()))
S = eval(input())
nums = ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")
isvalid = all(c in nums for c in S[:A] + S[-B:]) and S[A] == "-"
print(("Yes" if isvalid else "No"))

A, B = list(map(int, input().split()))
S = eval(input())
isvalid = all("0" <= c <= "9" for c in S[:A] + S[-B:]) and S[A] == "-"
print(("Yes" if isvalid else "No"))

-nums = ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9") -isvalid = all(c in nums for c in S[:A] + S[-B:]) and S[A] == "-" +isvalid = all("0" <= c <= "9" for c in S[:A] + S[-B:]) and S[A] == "-"