In the rest frame of the Local Group (LG), the total momentum of theMilky Way (MW) and Andromeda (M31) should balance to zero. We use thisfact to constrain new solutions for the solar motion with respect to theLG centre of mass, the total mass of the LG, and the individual massesof M31 and the MW. Using the set of remote LG galaxies at >350 kpcfrom the MW and M31, we find that the solar motion has amplitudeV⊙ = 299 ± 15 km s-1 in a directionpointing towards galactic longitude l⊙ = 98.4°± 3.6° and galactic latitude b⊙ = -5.9°± 3.0°. The velocities of M31 and the MW in this rest framegive a direct measurement of their mass ratio, for which we findlog10(MM31/MMW) = 0.36 ± 0.29.We combine these measurements with the virial theorem to estimate thetotal mass within the LG as MLG = (2.5 ± 0.4) ×1012 M⊙. Our value for MLG isconsistent with the sum of literature values for MMW andMM31. This suggests that the mass of the LG is almostentirely located within the two largest galaxies rather than beingdispersed on larger scales or in a background medium. The outskirts ofthe LG are seemingly rather empty. Combining our measurement forMLG and the mass ratio, we estimate the individual masses ofthe MW and M31 to be MMW = (0.8 ± 0.5) ×1012 M⊙ and MM31 = (1.7 ±0.3) × 1012 M⊙, respectively. Ouranalysis favours M31 being more massive than the MW by a factor of˜2.3, and the uncertainties allow only a small probability (9.8per cent) that the MW is more massive. This is consistent with otherproperties such as the maximum rotational velocities, total stellarcontent, and numbers of globular clusters and dwarf satellites, whichall suggest that MM31/MMW > 1.