  We report the measurements of the prompt and non-prompt J/{\psi} and
{\psi}(2S) nuclear modification factors (RAA) using pp and PbPb data and the
RpPb using pPb data collected by CMS at the LHC. All measurements were
performed via the di-muon decay channel. The RAA analysis is based on PbPb and
pp data samples collected at 5.02 TeV in 2015, corresponding to integrated
luminosities of 464 {\mu}b-1 and 28 pb-1. These measurements are performed in
the di-muon rapidity range of |y| < 2.4 as a function of centrality, rapidity,
and transverse momentum (pT) from pT = 3 GeV/c in the most forward region and
up to 50 GeV/c. The RpPb analysis based on pPb data, is performed for prompt
J/{\psi} and {\psi}(2S) in different kinematic bins of pT and rapidity.
