Install the O2 after the header pipe merge. I like about 10" back if you have the room. It's okay to install the O2 after the flange too, as long as the gasket is good. Then make sure the O2 sensor is rotated as shown so that water does not condense and collect in the sensor.