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