States in 12C and 16O investigated by the 11B(d, n) and 15N(d, n) reactions