strs = input() str_list = strs.split(' ') num_list = [int(i) for i in str_list] heisei=False if num_list[0] > 1989 and num_list[0] < 2019: heisei = True elif num_list[0] == 1989 and (num_list[1] >= 2 or (num_list[1] == 1 and num_list[2] >= 8)): heisei = True elif num_list[0] == 2019 and num_list[1] <= 4: heisei = True if heisei == True: print("Yes") else: print("No")