The 14M has fixed inputs and outputs, the 14M2 allows more flexible configuration of which pins are used for input or output.
So long as you put your inputs on the left of the chip (C.x pins) and have your outputs from the right of the chip (B.x pins) the wiring and code should be the same for both.