In an acute-angled triangle $ABC$, $M$ and $N$ are points on the sides $AC$ and $BC$ respectively, and $K$ the midpoint of $MN$. The circumcircles of triangles $ACN$ and $BCM$ meet again at a point $D$. Prove that the line $CD$ contains the circumcenter $O$ of $\triangle ABC$ if and only if $K$ is on the perpendicular bisector of $AB.$