import java.io.*; import java.util.Scanner; public class Main_yukicoder779 { private static Scanner sc; private static Printer pr; private static void solve() { int y = sc.nextInt(); int m = sc.nextInt(); int d = sc.nextInt(); if (y > 1989 && y < 2019) { pr.println("Yes"); } else if (y == 1989) { if (m > 1) { pr.println("Yes"); } else { if (d >= 8) { pr.println("Yes"); } else { pr.println("No"); } } } else if (y == 2019) { if (m < 4) { pr.println("Yes"); } else if (m == 4) { if (d <= 30) { pr.println("Yes"); } else { pr.println("No"); } } else { pr.println("No"); } } else { pr.println("No"); } } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } static class Printer extends PrintWriter { Printer(OutputStream out) { super(out); } } }