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