Exponentiation of leading infrared divergences in massless Yang-Mills theories