We consider two-dimensional large N gauge theory with D adjoint scalars on a torus, which is obtained from a D+2 dimensional pure Yang-Mills theory on T D+2 with D small radii. The two dimensional model has various phases characterized by the holonomy of the gauge field around non-contractible cycles of the 2-torus. We determine the phase boundaries and derive the order of the phase transitions using a method, developed in an earlier work (hepth/0910.4526), which is nonperturbative in the 'tHooft coupling and uses a 1/D expansion. We embed our phase diagram in the more extensive phase structure of the D + 2 dimensional Yang-Mills theory and match with the picture of a cascade of phase transitions found earlier in lattice calculations (hep-lat/0710.0098). We also propose a dual gravity system based on a Scherk-Schwarz compactification of a D2 brane wrapped on a 3-torus and find a phase structure which is similar to the phase diagram found in the gauge theory calculation. N . The α(x µ ) are valid gauge transformations locally, and leave local colour-singlets e.g. trF 2 µν invariant; in particular they commute with the hamiltonian. However, under the α-transformations W µ → h µ W µ . A non-zero value of W µ implies spontaneous symmetry breaking of the centre symmetry in the µ-direction.4 Kaluza Klein reduction is tricky for gauge theories [3,11], since in the confined phase the KK modes can have energies ∼ 1/(N L), which become arbitrarily low at large N . The fractional modes, equivalent to the 'long string' modes of [12], can be understood as arising from mode shifts of charged fields in the presence of Wilson lines whose eigenvalues are uniformly distributed along a circle (see Section 2 for an explicit verification for this statement). In the deconfined phase, however, the KK modes have energies ∼ 1/L, like in ordinary field theories, and KK reduction proceeds as usual.