a,b,c=map(int,input().split()) if a>1988 and c>7 or a<2020 and b<5:print("Yes") else:print("No")