The first ionisation increases from left to right in a period. But nitrogen has greater ionisation energy than oxygen. The reason is that the electronic configuration of nitrogen $ (1{{s}^{2}}2{{s}^{2}}2{{p}^{3}}) $ is stabler than that of oxygen. Hence, nitrogen requires more energy to loose an electron then oxygen.