Y,M,D=map(int,input().split()) if 1990<=Y<=2018: print('Yes') elif Y==1989 and M==1 and D==1 or 2 or 3 or 4 or 5 or 6 or 7: print('No') elif Y==2019 and M>5: print('No') else: print('Yes')