Eliminate third diagonal for X and Y.
Eliminate third diagonal for M.