Out of H and ${ H }_{ 2 }$, the latter has higher first ionisation energy

Out of H and ${ H }{ 2 }$, the latter has higher first ionisation energy while out of O and
${ O }
{ 2 }$, the former has higher first ionisation energy. Explain why?

In ${ H }_{ 2 }$, first electron has to be removed from σ (Is) which has lower energy (more stable) than H-atom. In 02, first electron has to be removed from It $\pi$(2px )or $\pi$ (2py) orbital which has higher energy than 2p-orbital of O-atom.