import java.util.*; import java.text.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int y = sc.nextInt(); int m = sc.nextInt(); int d = sc.nextInt(); solve(y, m, d); } static void solve(int y, int m, int d) throws Exception { DateFormat df = new SimpleDateFormat("yyyyMMdd"); String str = String.format("%04d", y) + String.format("%02d", m) + String.format("%02d", d); Calendar target = prepareCalendar(str, df); Calendar begin = prepareCalendar("19890108", df); Calendar end = prepareCalendar("20190430", df); if( !begin.after(target) && !end.before(target) ) { System.out.println("Yes"); } else { System.out.println("No"); } } static Calendar prepareCalendar(String s, DateFormat df) throws Exception { Calendar cal = Calendar.getInstance(); cal.setTime(df.parse(s)); return cal; } }