The binding energies of nuclei X and Y are E1 and E2 respectively. Two atoms of X fuse together to give one atom of Y and some amount of energy,Q is released. Then
Q=E2 - 2E1
During fusion , binding energy of daughter nucleus is always greater than the total binding energy of the parent nuclei. The difference of binding energies is released.