#import numpy as np def get_data(): Y, M, D = input().split(' ') return int(Y), int(M), int(D) def heisei(Y,M,D): if Y > 1989 and Y<2019: return True elif Y==1989: if M == 1: if D<8: return False else: return True else: return True elif Y==2019: if M<5: return True else: return False else: return False def main(): Y, M, D = get_data() if heisei(Y,M,D): print("Yes") else: print("No") if __name__=='__main__': main()