p = input() pi = p[::-1] k = 0 add = [12,13,14] for i in range(len(p)): f = False for a in add: i0 = (a+k)%10 i1 = (a+k)//10 if str(i0) == pi[i]: f = True k = i1 break if f: continue ind = i break if pi[i] == '1' and i == len(p)-1: print('Yes') exit() if (pi[i] == '8' or pi[i] == '7') and (pi[i+1:].count('7')+pi[i+1:].count('6'))==len(p)-i-1: print('Yes') else: print('No')