We make use of the global symmetries of the Yang-Mills theory on the lattice to design a new computational strategy for extracting glueball masses and matrix elements which achieves an exponential reduction of the statistical error with respect to standard techniques. By generalizing our previous work on the parity symmetry, the partition function of the theory is decomposed into a sum of path integrals each giving the contribution from multiplets of states with fixed quantum numbers associated to parity, charge conjugation, translations, rotations and central conjugations Z_N^3. Ratios of path integrals and correlation functions can then be computed with a multi-level Monte Carlo integration scheme whose numerical cost, at a fixed statistical precision and at asymptotically large times, increases power-like with the time extent of the lattice. The strategy is implemented for the SU(3) Yang--Mills theory, and a full-fledged computation of the mass and multiplicity of the lightest glueball with vacuum quantum numbers is carried out at a lattice spacing of 0.17 fm.