import datetime n = list(map(int, input().split())) if datetime.date(1989, 1, 8) <= datetime.date(n[0], n[1], n[2]) <= datetime.date(2019, 4, 30): print("Yes") else: print("No")