y,m,d = map(int,input().split()) if 1990 <= y <= 2018: print("Yes") elif y ==1998: if m >= 2: print("Yes") elif m==1 and d >= 8: print("Yes") else: print("No") elif y ==2019: if m <= 3: print("Yes") elif m==4 and d <= 30: print("Yes") else: print("No") else: print("No")