Spectra of cosmic ray carbon and oxygen nuclei according to the NUCLEON experiment