import java.util.*; 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(); String ans; if (y < 1989 || y > 2019) { ans = "No"; } else if (y == 1989) { if (m == 1 && d < 8) { ans = "No"; } else { ans = "Yes"; } } else if (y == 2019) { if (m <= 4) { ans = "Yes"; } else { ans = "No"; } } else { ans = "Yes"; } System.out.println(ans); } }