The product of two matrices A and B is defined if the number of columns of A is equal to the number of rows of B.