import java.util.Scanner; public class No779 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int Y = s.nextInt(),M = s.nextInt(),D = s.nextInt(); s.close(); int total = Y * 10000 + M * 100 + D; if(total >= 19890108 && total <= 20190430){ System.out.println("Yes"); }else{ System.out.println("No"); } } }