Let $E$ be a point on the median $AD$ of a triangle $ABC$, and $F$ be the projection of $E$ onto $BC$. From a point $M$ on $EF$ the perpendiculars $MN$ to $AC$ and $MP$ to $AB$ are drawn. Prove that if the points $N,E,P$ lie on a line, then $M$ lies on the bisector of $\angle BAC$.