s = input() r = 'No' if s[-1] in '234': for i in range(len(s)-1)[::-1]: if s[i] not in '345': break if (i==0 and s[i]=='1') or s[i] in '87' and all(d in '67' for d in s[:i]): r = 'Yes' print(r)