from datetime import date begin = date(1989, 1, 8) end = date(2019, 4, 30) y, m, d = map(int, input().split()) day = date(y, m, d) if begin <= day <= end: ans = "Yes" else: ans = "No" print(ans)