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