Stars generate energy by the nuclear fusion of elements. Unlike the Sun, massive stars possess the mass needed to fuse elements that have an atomic mass greater than hydrogen and helium, albeit at increasingly higher temperatures and pressures, causing correspondingly shorter stellar life spans. The degeneracy pressure of electrons and the energy generated by these fusion reactions are sufficient to counter the force of gravity and prevent the star from collapsing, maintaining stellar equilibrium. The star fuses increasingly higher mass elements, starting with hydrogen and then helium, progressing up through the periodic table until a core of iron and nickel is produced. Fusion of iron or nickel produces no net energy output, so no further fusion can take place, leaving the nickel–iron core inert. Due to the lack of energy output creating outward thermal pressure, the core contracts due to gravity until the overlying weight of the star can be supported largely by electron degeneracy pressure.