from datetime import date def main(): y, m, d = map(int, input().split()) start = date(1989, 1, 8) end = date(2019, 4, 30) d = date(y, m, d) if start > d or end < d: print("No") else: print("Yes") if __name__ == '__main__': main()