Nitrogen ($2p^3$) possesses a stable half-filled $p$ subshell, which requires extra energy to remove an electron. Oxygen ($2p^4$) has one paired $p$ orbital whose electron-electron repulsion makes it easier to ionise, so $IE_1(N) > IE_1(O)$ and the reason correctly explains the assertion.