Hydrocarbons straight from the ground definitely contain a bunch of other crap, somewhat famously sulfur. I don't know what happens to the N and O, though.