y,m,d = list(map(int,input().split())) if (19891) or (y==1989 and m==1 and d>=8) or (y==2019 and m<=4): print("Yes") else: print("No")