S=int(input()) if S>=19890108 and S<=20190430: print('Yes') else: print('No')