Let $A=\begin{pmatrix} 1 & 2 \\ 0 & 1\end{pmatrix}$ and $B=\begin{pmatrix} 1 & 0 \\ -2 & 1\end{pmatrix}$.
Can a product $X_1 X_2...X_n$ be equal to the identity matrix if every factor $X_i$ equals either $A$ or $B$?
I believe that the answer is negative, but I don't really know how to prove it. I thought of two approaches:
We could try doing this by induction. The base case is trivial since neither of $A$ nor $B$ are the identity matrix. However, I don't know how to go from $n$ to $n+1$.
Maybe we should use the fact that if $U, V$ are two square matrices such that $UV$ is the identity, then $VU$ is also the identity. I guess that we should somehow shuffle the order of the factors using this observation, but then again, I don't know how to use this.