import sys readline=sys.stdin.readline import datetime Y,M,D=map(int,readline().split()) if datetime.date(1989,1,8)<=datetime.date(Y,M,D)<=datetime.date(2019,4,30): ans="Yes" else: ans="No" print(ans)