Y, M, D = map(int, input().split()) if (1989, 1, 8) <= (Y, M, D) <= (2019, 4, 30): yes = True else: yes = False print('Yes' if yes else 'No')