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 (1s22s22p3) is stabler than that of oxygen. Hence, nitrogen requires more energy to loose an electron then oxygen.