Why doesn't fusion contradict the 1st law of thermodynamics? I was reading up on the 1st law of thermodynamics for my Chemistry exam and I was wondering why doesn't fusion contradict the 1st law of thermodynamics? 
The 1st law states that

The energy of an isolated system is constant

or that whatever is put into the system, you get out of it, but in fusion you get more out of the initial reactions than you put in
Hydrogen + Hydrogen = Helium etc.
I am still a bit confused...
Thanks for any help! 
 A: By that logic, a battery violates the law also.
"Look, all I did was put in enough energy to flip a switch, and now an LED keeps shining and shining! I got more energy out than I put in!"
In nuclear fusion, we are releasing some latent energy which is present in the materials, by changing the nuclear structure into other materials that contain less energy.
The energy we are getting out was "put in" to those nuclear reagents.
A: To answer the question simply, $E=mc^2$.
Energy is a manifestation of mass, and mass is a manifestation of energy. In a fusion or fission process, the total "energy" of the system remains constant, it just changes shape.
By "energy" I mean the totality of the already present energy, and the bound energy of the mass that takes part in the reaction.
A: You have to realize that thermodynamics emerges from the bulk properties of matter, and this is seen better when one goes to the formalism of statistical mechanics. The first law of thermodynamics is the form conservation of energy takes in the thermodynamics mathematical framework which is constrained by classical physics.
As you must know from your chemistry courses, there exists the world of quantum mechanics, which is responsible for the existence of chemistry  and its governing laws, another framework.
Special relativity has been validated experimentally many times over, and it tells us that mass itself is a type of energy .The law of conservation of energy, as @SWeko explains  in his answer, includes the energy contained in the masses of the particles under consideration, the total energy being E=m*c^2.
In a similar manner where energy can be stored in chemical reactions, which can be released under appropriate conditions, energy is stored in nuclear reactions, of which fission and fusion are expressions. 
In the realm of special relativity there is no meaning to the first law, because it does not describe nuclear reactions. Once the energy released by a nuclear reaction is taken into the equations then one can consider the thermodynamic properties of the sample resulting from fission or fusion.
