Y, M, D = map(int, input().split()) start = (1989, 1, 8) end = (2019, 4, 30) date = (Y, M, D) print("Yes" if start <= date <= end else "No")