a=int(input()[0]);s=eval(input());print(("YNeos"[s.count("-")!=1or s[a]>"-"::2]))
a=int(input()[0]);s=eval(input());print(("YNeos"[s.count("-")!=1or"-"<s[a]::2]))
a = int(input()[0])
s = eval(input())
print(("YNeos"[s.count("-") != 1 or s[a] > "-" :: 2]))

a = int(input()[0])
s = eval(input())
print(("YNeos"[s.count("-") != 1 or "-" < s[a] :: 2]))

-print(("YNeos"[s.count("-") != 1 or s[a] > "-" :: 2])) +print(("YNeos"[s.count("-") != 1 or "-" < s[a] :: 2]))