input_params = list(map(int,input().split())) year = input_params[0] month = input_params[1] day = input_params[2] res = 'No' if 1989 < year and year < 2019: res = 'Yes' elif year == 1989: if month > 1: res = 'Yes' elif month == 1 and day >= 8: res = 'Yes' elif year == 2019 and month < 5: res = 'Yes' print(res)