inp = input() split_first = inp.split(' ') Y = int(split_first[0]) M = int(split_first[0]) D = int(split_first[0]) def hantei(Y,M,D): if (1989<=Y and 1<=M and 8<=D) and (Y<=2019 and M<=4 and D<=30): print('Yes') else: print('No') hantei(Y,M,D)