By Newtons second law for system of bodies, { F }_{ external }=m{ a }_{ CM } . This equation does not involve internal forces between bodies. SInce in this case, no horizontal force exists on the system of two parts and hence COM will not shift.