import datetime y,m,d = map(int,input().split()) now = datetime.date(y,m,d) comp1 = datetime.date(1989,1,8) comp2 = datetime.date(2019,4,30) if comp1 <= now <= comp2: print("Yes") else: print("No")