y,m,d=map(int,input().split()) if 1980108<=int(f"{y:04}{m:02}{d:02}")<=20190430:print("Yes") else:print("No")