Y, M, D = map(int,input().split()) if len(list(str(M))) == 1: Ms = '0' + str(M) if len(list(str(M))) == 2: Ms = str(M) if len(list(str(D))) == 1: Ds = '0' + str(D) if len(list(str(D))) == 2: Ds = str(D) A = int(str(Y) + Ms + Ds) ans = "none" if A < 19890108 or A > 20190430: ans = "No" elif A >= 19890108 and A <= 20190430: ans = "Yes" print(ans)