Search for dark matter produced in association with a Higgs boson decaying to γγ or τ +τ at \( \sqrt{s}=13 \) TeV