import datetime as d;y,m,s=map(int,input().split());print("NYoe s"[d.datetime(1989,1,7)