Variational calculations of vibrational energy levels have been carried out in order to study vibrational bonding for the IXI and BrXBr molecules with X = Mu, H, and D. Extended London-Eyring-Polanyi-Sato (LEPS) and three-center diatomics-in-molecules (DIM) potential energy surfaces have been used for IXI. For BrXBr, a three-center DIM potential surface was employed. The LEPS surface is purely repulsive, whereas the DIM potentials possess two van der Waals minima. The variational calculations use the exact Hamiltonian of Watson and provide rigorous upper bounds to the energy levels. Calculations have been performed both for the collinear configurations of the atoms as well as in three dimensions, with the total angular momentum quantum number equal to zero. The bond energies of YXY, where Y = Br and I, increase in the order D