s = input() if s[0]=='1' and s[-1] in '234' and all(2<=int(d)-1<=4 for d in s[1:-1]): print('Yes') else: print('No')