y,m,d = map(int,input().split()) import datetime date1 = datetime.date(y,m,d) date2 = datetime.date(1989,1,8) date3 = datetime.date(2019,4,30) print("Yes") if (date1 >= date2) and (date1 <= date3) else print("No")