Y,M,D= map(int,input().split()) if Y<1989 or 2019=8: print("Yes") if Y==2019: if M<=4: print("Yes") else: print("No")