These elements belong to the second period in the modern periodic table.
As we move from left to right across a period, atomic size decreases. This results in a greater pull on the electrons and therefore more energy is required to remove them.
The correct order of first ionisation energy would be:
O > C > B > Be