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 s = "" + y; if(m < 10) { s += ("0" + m); } else { s += m; } if(d < 10) { s += ("0" + d); } else { s += d; } int sd = Integer.parseInt(s); String ans = "No"; if((sd >= 19890108) && (sd <= 20190430)) ans = "Yes"; System.out.println(ans); } }