A search is presented for massive resonances decaying either into two Higgs (H) bosons or into a Higgs and a vector (V = W or Z) boson. The decay channels considered are and . This analysis is based on the data sample of proton-proton collisions collected at a center-of-mass energy of 13~\mathrm{TeV} by the CMS Collaboration in , corresponding to an integrated luminosity of 35.9~\mathrm{fb}^{-1}. For the high-mass resonances considered (\gtrsim 1~\mathrm{TeV}), substructure techniques are employed to differentiate between the hadronization products of a vector boson decaying to quarks, a Higgs boson decaying to bottom quarks, and quark- or gluon-induced jets. Due to the large boost of the Higgs boson, the two leptons in the decay are collimated. Advanced techniques are used for events in which one lepton decays hadronically and the other leptonically, and in which both decay hadronically. Upper limits at confidence level are set on the product of cross section times branching fraction for resonance masses between and 4000~\mathrm{GeV}, ranging from to 6~\mathrm{fb} for spin and resonances, and from to 6~\mathrm{fb} for spin resonances.