a, b = [int(i) for i in input().split()]
s = input()
s_top = int(s[:a])
s_middle = s[a:a+1]
s_under = int(s[a+1:a+b+1])
if(s_top >= pow(10, a-1) and s_top < pow(10, a)) and s_middle == '-' and (s_under >= pow(10, b-1) and s_under < pow(10, b)):
  print("YES")
else:
  print("NO")