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