import re;print((re.search('.1',eval(input()))and'No'or'Yes'))
print(('YNeos'[input()[1:].find('1')>=0::2]))
import re

print((re.search(".1", eval(input())) and "No" or "Yes"))

print(("YNeos"[input()[1:].find("1") >= 0 :: 2]))

-import re - -print((re.search(".1", eval(input())) and "No" or "Yes")) +print(("YNeos"[input()[1:].find("1") >= 0 :: 2]))