Determination of the running coupling in the SU(2) Yang-Mills theory from first principles