A condition for the solvability of the model matching problem