nums = input() data = map(int, nums.spit(' ')) if 1989 <= data[0] <= 2019: if data[0] == 1989: if data[1] == 1: if data[2] >= 8: print('Yes') else: print('No') else: print('Yes') elif data[0] == 2019: if data[0] <= 4: print('Yes') else: print('No') else: print('Yes') else: print('No')