y,m,d=map(int,input().split()) a=0 if y<1989 or y>2019: a=1 elif y==1989: if m==1: if d<8: a=1 elif y==2019: if m>4: a=1 print('YNeos'[a::2])