S = input()[::-1] x = [] y = [] z = 0 for c in S : d = ord(c) - ord('0') - z if 2 <= d <= 4 : if d == 2 : x.append(6) y.append(6) elif d == 3: x.append(6) y.append(7) else : x.append(7) y.append(7) z = 1 elif 6 <= d <= 7 : x.append(d) z = 0 elif d == 0 : z = 0 else : print('No') quit() z = 0 for i in range(len(S)) : s = z if i < len(x) : s += x[i] if i < len(y) : s += y[i] z = s//10 s -= z*10 if ord(S[i]) - ord('0') != s : print('No') quit() if z != 0 or len(x) == 0 or len(y) == 0: print('No') else : print('Yes')