I want to find solutions for matrices $A\in \mathbb{R}^{m\times n}$ and $B\in \mathbb{R}^{n\times m}$ in the following equations:
$$ \left\{ \begin{matrix} A^TM_1 = A^T(AB\odot M_2) \\ M_1B^T = (AB\odot M_2) B^T \end{matrix} \right., $$ where $M_1,M_2\in \mathbb{R}^{m\times m}$ are known invertible matrices, and $\odot$ represents Hardamard product. Through vectorization we can have the following equations: $$ \left\{ \begin{matrix} (I\otimes A^T) \operatorname{vec}(M_1) = (I \otimes A^T)\operatorname{diag}(\operatorname{vec}(M_2)) (I \otimes A)\operatorname{vec}(B) \\ (B\otimes I) \operatorname{vec}(M_1) = (B\otimes I)\operatorname{diag}(\operatorname{vec}(M_2)) (B^T\otimes I)\operatorname{vec}(A) \end{matrix} \right., $$ where $\otimes$ represents Kronecker product, $\operatorname{diag}()$ denotes the diagonal matrix. However, I'm stuck on this step. We get $\operatorname{vec}(B)$ in the first equation, but how to transform it into $(B\otimes I)$?