y, m, d = map(int, input().split()) if y < 1989: ans = "No" elif y == 1989: if m == 1 and d < 8: ans = "No" else: ans = "Yes" elif 1989 < y < 2018: ans = "Yes" elif y == 2019: if m < 4: ans = "Yes" elif m == 4 and d <= 30: ans = "Yes" else: ans = "No" else: ans = "No" print(ans)