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