#yuki653 import re n=raw_input() r=re.match("^(1|[67]*[78])[3-5]*[2-4]$",n) if r: print 'Yes' else: print 'No'