Inclusive search for a boosted Higgs boson and observation of the Z boson decaying to charm quarks with the CMS experiment