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