import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); char[] arr = sc.next().toCharArray(); int length = arr.length; if (arr[length - 1] < '2' || arr[length - 1] > '4') { System.out.println("No"); return; } boolean flag = false; for (int i = length - 2; i >= 1; i--) { if (flag) { if (arr[i] < '6' || arr[i] > '7') { System.out.println("No"); return; } } else { if (arr[i] >= '3' && arr[i] <= '5') { continue; } else if (arr[i] >= '7' && arr[i] <= '8') { flag = true; } else { System.out.println("No"); return; } } } if (flag) { if (arr[0] < '6' || arr[0] > '7') { System.out.println("No"); } else { System.out.println("Yes"); } } else { if (arr[0] == '1' || arr[0] == '7' || arr[0] == '8') { System.out.println("Yes"); } else { System.out.println("No"); } } } }