$$ {\bf Y}^\top {\bf Y} = {\bf X}^\top {\bf A}^\top {\bf A} {\bf X} $$
Since $\bf X$ is rank-$m$, the matrix $\bf X X^\top$ is invertible. Thus,
$$ \left( {\bf X} {\bf X}^\top \right)^{-1} {\bf X} {\bf Y}^\top {\bf Y} {\bf X}^\top \left( {\bf X} {\bf X}^\top \right)^{-1} = {\bf A}^\top {\bf A} $$
Hence, one solution can be found via the Cholesky decomposition of $ \left( {\bf X} {\bf X}^\top \right)^{-1} {\bf X} {\bf Y}^\top {\bf Y} {\bf X}^\top \left( {\bf X} {\bf X}^\top \right)^{-1} $, i.e.,
$$ \hat {\bf A} := \operatorname{Cholesky} \left( \left( {\bf X} {\bf X}^\top \right)^{-1} {\bf X} {\bf Y}^\top {\bf Y} {\bf X}^\top \left( {\bf X} {\bf X}^\top \right)^{-1} \right) $$
Plugging into the original matrix equation,
$$ {\bf Y}^\top {\bf Y} = {\bf X}^\top {\hat {\bf A}}^\top {\hat {\bf A}} \, {\bf X} = {\bf X}^\top \left( {\bf X} {\bf X}^\top \right)^{-1} {\bf X} {\bf Y}^\top {\bf Y} \underbrace{{\bf X}^\top \left( {\bf X} {\bf X}^\top \right)^{-1} {\bf X}}_{=: {\bf P}} = {\bf P} \, {\bf Y}^\top {\bf Y} {\bf P} $$
where $\bf P$ is the $n \times n$ projection matrix that projects onto the $n$-dimensional row space of $\bf X$. Thus, I am tempted to conclude that the original matrix equation has a solution if $ {\bf Y}^\top {\bf Y} = {\bf P} \, {\bf Y}^\top {\bf Y} {\bf P}$. This is the case if the rows of $\bf Y$ are in the row space of $\bf X$.