Y,M,D =map(int,input().split()) m = 3000 def f(A,B,C): return A*(m**2)+B*m +C if f(1989,1,8) <= f(Y,M,D) <= f(2019,4,30): print("Yes") else: print("No")