import datetime def main(): d = input() s = d.split(" ") asc_date = datetime.date(int(s[0]), int(s[1]), int(s[2])) heisei_start = datetime.date(1989, 1, 8) heisei_end = datetime.date(2019, 4, 30) if heisei_start <= asc_date <= heisei_end: print("Yes") print("No") main()