Let $ABCD$ be a square and let $M$ be the midpoint of $BC$. Let $X$ and $Y$ be points on the segments $AB$ and $CD$, respectively. Prove that $\angle XMY = 90^\circ$ if and only if $BX + CY = XY$. Note: In the competition, students were only asked to prove the 'only if' direction.