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