y,m,d=map(int,input().split()) ans="No" if y >= 1990 and y <= 2018 : ans="yes" elif y==1989 and m > 2: ans="yes" elif y==1989 and m==1 and d>8: ans="yes" elif y==2019 and m<4: ans="yes" print(ans)