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