import datetime date = datetime.datetime.strptime('/'.join([x for x in input().split(' ')]), '%Y/%m/%d') s_period = datetime.datetime.strptime('1989/1/8', '%Y/%m/%d') e_period = datetime.datetime.strptime('2019/04/30', '%Y/%m/%d') if s_period <= date <= e_period: print('Yes') else: print('No')