A, B = list(map(int, input().split()))
S = input()
a = S[0:A]
x = S[A]
b = S[A + 1:]
print(a, x, b)
if list(a).count("-") == 0 and x == "-" and list(b).count("-") == 0:
	print("Yes")
else:
	print("No")