import datetime date = datetime.datetime.strptime('/'.join([x for x in input().split(' ')]), '%Y/%m/%d') s_period = datetime.datetime.strptime('1969/12/31', '%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')