firstdata = input() secdata = firstdata.split(" ") year_d = int(secdata[0]) month_d = int(secdata[1]) day_d = int(secdata[2]) result = "" if year_d > 2020 or year_d < 1989: result = "No" else: if year_d == 1989 and month_d ==1 and day_d <= 7: result = "No" elif year_d == 2019 and month_d >=5: result = "No" else: result = "Yes" print(result)