Y,M,D = map(int,input().split()) if Y < 1989: print('No') elif Y == 1989: if M == 1 and D <= 8: print('No') else: print('Yes') elif Y < 2019: print('Yes') elif Y == 2019: print('Yes' if M < 5 else 'No') else: print('No')