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

flag=True
if S[A]!='-':
    flag=False
a=S[:A]
b=S[A+1:]
print(a)
print(b)
if not(a.isdigit() and b.isdigit()):
    flag=False
if flag:
    print('Yes')
else:
    print('No')
