Exclusive photoproduction of vector mesons in the perturbative two-gluon exchange formalism depends significantly on nucleon and nuclear gluon distributions. In the present study we calculate total cross sections and rapidity distributions of J/ψ(1s), ψ(2s), Υ(1s), Υ(2s), and Υ(3s) in ultraperipheral proton-lead (pPb) and lead-lead (PbPb) collisions at the CERN Large Hadron Collider (LHC) at √ s N N = 5 TeV and √ s N N = 2.76 TeV respectively. Effects of gluon shadowing are investigated and potentials for constraining nuclear gluon modifications are discussed. On the theory front it has been extensively studied at various energies and for different collision systems (see for instance [2][3][4][5][6][7][8][9][10][11][12][13][14][15][16][17][18]). Diverse approaches ranging from models based on perturbative Quantum Chromodynamics (pQCD) to Color Dipole models and k T factorization have been used to study coherent and incoherent photoproduction of heavy mesons. The characteristics of some of the currently employed models is discussed in [1].In previous works [6][7][8] we have considered coherent photoproduction of J/ψ(1s) and Υ(1s) at various energies in pPb and PbPb collisions at the LHC. The calculations were carried out in the framework of perturbative two-gluon exchange formalism with different nuclear gluon distributions and a detailed exposition can be found in [6] (see also [19,20]). In the current article we extend these previous studies by considering, in addition to J/ψ(1s) and Υ(1s), the exclusive photoproduction of ψ(2s), Υ(2s), and Υ(3s) in ultraperipheral pPb (at √ s N N = 5 TeV) and PbPb (at √ s N N = 2.76 TeV) collisions at the LHC. For brevity we will refer to J/ψ(1s) and ψ(2s) collectively as ψ mesons, and Υ(1s), Υ(2s), and Υ(3s) as Υ mesons. The calculation framework remains essentially unchanged; the only additional assumption is that the multiplicative correction factor ζ V introduced in [6] and determined for J/ψ(1s) is applicable to ψ(2s). The requisite input masses and widths of these mesons are taken from [21] and are shown in Table I. As in previous studies we use gluon distributions from MSTW08 [22], EPS08 [23], EPS09 [24], and HKN07