y,m,d = map(int,input().split()) ok = 0 if 1989 < y < 2018: ok = 1 if y==1988 and (m > 1 or d >= 8): ok = 1 if y==2019 and m <= 4: ok = 1 print("Yes" if ok else "No")