Gauge invariant effective action for the Polyakov line in the SU(N) Yang-Mills theory at high temperatures