y,m,d = map(int,input().split()) ans = y*10**4+m*10**2+d if 19890108 <= ans <= 20190430: print("Yes") else: print("No")