import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); char[] arr = br.readLine().toCharArray(); int length = arr.length; int last = arr[length - 1] - '0'; if (last < 2 && last > 4) { System.out.println("No"); return; } int num = 0; for (int i = last - 2; i >= 0; i--) { int x = arr[i] - '0'; if (num == 0) { if (i == 0) { if (x == 1 || x == 7 || x == 8) { System.out.println("Yes"); } else { System.out.println("No"); } return; } if (x - 1 >= 2 && x - 1 <= 4) { continue; } if (x - 1 == 6) { num = 6; } else if (x - 1 == 7) { num = 7; } else { System.out.println("No"); return; } } else { if (x != 6 && x != 7) { System.out.println("No"); return; } } } System.out.println("Yes"); } }