import datetime Y,M,D = map(int,input().split()) startday = datetime.datetime(1989,1,8) lastday = datetime.datetime(2019,4,30) theday = datetime.datetime(Y,M,D) if (startday < theday) and (theday < lastday): ans = "Yes" else: ans = "No" print(ans)