Testing order of matrix product