s=gets.chomp if /\A(1|[6-7]*[7-8])[3-5]*[2-4]\Z/ =~ s then puts "Yes" else puts "No" end