*N,=map(int,input().split()) print("Yes" if [1989,1,8]<=N<=[2019,4,30] else "No")