import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int Y = sc.nextInt(); int M = sc.nextInt(); int D = sc.nextInt(); sc.close(); if(1989 <= Y && Y <= 2019) { if(Y == 1989) { if(M == 1) { if(D >= 8) { System.out.println("Yes"); }else { System.out.println("No"); } }else { System.out.println("Yes"); } }else if(Y == 2019) { if(M > 4) { System.out.println("No"); }else { System.out.println("Yes"); } }else { System.out.println("Yes"); } }else { System.out.println("No"); } } }