In a triangle $ABC$ the excircle at the side $BC$ touches $BC$ in point $D$ and the lines $AB$ and $AC$ in points $E$ and $F$ respectively. Let $P$ be the projection of $D$ on $EF$. Prove that the circumcircle $k$ of the triangle $ABC$ passes through $P$ if and only if $k$ passes through the midpoint $M$ of the segment $EF$.