A,B = map(int,input().split())
S = str(input())
len_S = len(list(S))
print(S[A+1:])
if S[A] == "-" and len_S == A+B+1 and S[0:A] != "-" and S[A+1:] != "-":
        print("Yes")
else:
        print("No")