Astrophysical oscillator strengths for TiO and VO bands from spectrum synthesis of spectral types M1 III to M7 III