The compounds of the formula I, the N-oxides, tautomers, the prodrugs and the pharmaceutically acceptable salts thereof are inhibitors of phosphodiesterase type 10A and to their use for the manufacture of a medicament and which thus are suitable for treating or controlling of medical disorders selected from neurological disorders and psychiatric disorders, for ameliorating the symptoms associated with such disorders and for reducing the risk of such disorders.