Observation of the Higgs boson decay to a pair of τ leptons with the CMS detector