Although there is a general trend and the first ionisation energy increases across a period, the first ionisation energy falls from nitrogen to oxygen.
There is a fall in first ionisation energy from nitrogen in group 5 to oxygen in group 6 because the paired electrons in the 2p sub-shell of oxygen repel one another, making it easier to remove one electron.
Period 2 ionisation energies kJmol-1:

There is a fall in first ionisation energy from nitrogen in group 5 to oxygen in group 6 because the paired electrons in the 2p sub-shell of oxygen repel one another, making it easier to remove one electron.
Period 2 ionisation energies kJmol-1:
| Li | Be | B | C | N | O | F | Ne |
| 520.2 | 899.5 | 800.6 | 1086.5 | 1402.3 | 1313.9 | 1681.0 | 2080.7 |