a, b = [int(i) for i in input().split()]
content = input()

if len(content) == a + b + 1:
    A = content[:a]
    B = content[-b:]
    hyphn = content[a]
    print(A, B)
    if A.isdecimal() and B.isdecimal() and hyphn == '-':
        print('Yes')
    else :
        print('No')
