import datetime y, m, d = map(int, input().split()) date = datetime.date(y, m, d) start_heisei = datetime.date(1989, 1, 8) end_heisei = datetime.date(2019, 4, 30) if start_heisei <= date <= end_heisei: print("Yes") else: print("No")