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