Compounds of the general formula (I), wherein one of X1 and X2 represents N, and the other one of X1 and X2 represents -C(CH3), A represents unsubstituted or substituted 5-, 6-or 10-membered aryl or heteroaryl, n is 0 or 1 and B is a bicyclic heteromoiety defined in the specification. Compounds are phosphodiesterase 10A inhibitors and can find use in medicine in the treatment psychotic, neurological and cognitive functions diseases and disorders. (I)