import datetime import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines y, m, d = list(map(int, input().split())) start = datetime.datetime(1989, 1, 8) end = datetime.datetime(2019, 4, 30) cur = datetime.datetime(y, m, d) if start <= cur <= end: print("Yes") else: print("No")