We have performed simulations to investigate the dynamics of the M dwarf star GJ 876 in an attempt to reveal any stabilizing mechanism for sustaining the system.We simulated different coplanar and noncoplanar configurations of two-planet systems and other cases.From the simulations,we found that the 2 :1 mean-motion resonance between two planets can act as an effective mechanism for maintaining the stability of the system.This result is explained by a proposed analytical model.Using this model,we studied the region of motion of the inner planet by varying the parameters of the system,and we detected that the analytical results are well consistent with the numerical simulations.