import sys

data = list(sys.stdin.readline())

ans = True
expected = 0

for byte in xrange(len(data) // 8):
    if data[byte * 8] == "1":
        if expected > 0:
            ans = False
            break
        cars = 7
        while data[byte * 8 + cars] == "0":
            cars -= 1
        expected = 7 - cars
    else:
        expected -= 1
        if expected < 0:
            ans = False
            break

if not ans or expected != 0:
    print "No"
else:
    print "Yes"