Y,M,D = map(int,input().split()) if 1989 < Y < 2019: print("Yes") elif Y == 1989: if M > 1: print("Yes") else: if D > 7: print("Yes") else: print("No") elif Y == 2019: if M < 5: print("Yes") else: print("No") else: print("No")