We argue that the infinite-dimensional BMS symmetry discovered by Bondi et. al in the 60s provides an exact symmetry of the quantum gravity S-matrix. The Ward identity of this symmetry is shown to be precisely Weinberg's soft graviton theorem, also discovered in the 60s. A parallel infinite-dimensional symmetry is found to be generated in nonabelian gauge theories by gauge transformations which go to an angle-dependent finite constant at null infinity. The Ward identity of this symmetry is shown to be the soft gluon theorem.