  Given a number field we construct a canonical Galois gerbe over it and show
that its cohomology provides a bridge between the refined local endoscopy
introduced in arXiv:1304.3292 and classical global endoscopy. As particular
applications, we express the canonical adelic transfer factor that governs the
stabilization of the Arthur-Selberg trace formula as a product of normalized
local transfer factors, we give an explicit construction of the pairing between
an adelic L-packet and the corresponding S-group (based on the conjectural
pairings in the local setting) that is the essential ingredient in the
description of the discrete automorphic spectrum of a reductive group, and we
give a proof of some expectations of Arthur.
