Y,M,D=map(int,input().split()) ST=1989*10000+1*100+8 EN=2019*10000+4*100+30 AN=Y*10000+M*100+D print("Yes" if ST<=AN<=EN else "No")