Nitrogen is known to have a half-filled p-orbital and is quite stable. Therefore, the amoiunt of energy required to remove an electron from the valence shell of nitrogen will be much higher than the energy required to remove an electron from the valence shell of oxygen.