How are coal and petroleum formed ? Name two elements present in coal and petroleum in addition to carbon

Coal and petroleum were formed from the degradation of biomass millions of years ago. Other elements present - hydrogen, nitrogen, sulphur, oxygen, (any two)