y,m,d = map(int, input().split()) if y < 1989 or y > 2019: print('No') elif (y == 1989 and m > 1) or (y == 2019 and m > 4): print('No') elif y == 1989 and m == 1 and d > 8: print('No') else: print('Yes')