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

pattern = '[0-9]{3}-[0-9]{4}'

search_result = re.search(pattern, content)

if not(search_result) :
  print("No")
elif search_result.group() == content:
  print('Yes')
else:
  print("No")