Constraining the flux and cross section models using carbon and oxygen targets in the off-axis near detector for the 2016 joint oscillation analysis at T2K