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

s = eval(input())

for i in range(a):

    if s[i] == '-':

        print('No')

        exit(0)



if s[a] != '-':

    print('No')

    exit(0)



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

    if s[i] == '-':

        print('No')

        exit(0)



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

s = eval(input())

if '-' in s[:a]:

    print('No')

elif s[a] != '-':

    print('No')

elif '-' in s[a+1:]:

    print('No')

else:

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

a, b = list(map(int, input().split()))
s = eval(input())
if "-" in s[:a]:
    print("No")
elif s[a] != "-":
    print("No")
elif "-" in s[a + 1 :]:
    print("No")
else:
    print("Yes")

-for i in range(a): -    if s[i] == "-": -        print("No") -        exit(0) -if s[a] != "-": +if "-" in s[:a]: -    exit(0) -for i in range(a + 1, a + b): -    if s[i] == "-": -        print("No") -        exit(0) -print("Yes") +elif s[a] != "-": +    print("No") +elif "-" in s[a + 1 :]: +    print("No") +else: +    print("Yes")