PROBLEM TO BE SOLVED: To provide a novel compound having PDE10 inhibitory activity, or its pharmacologically acceptable salt.SOLUTION: This invention provides a compound represented by formula [I], or its pharmacologically acceptable salt, wherein a ring A is nitrogen-containing heteroaryl or the like; a ring B is an aliphatic monocyclic group or the like; X-Xare: (1) Xand Xare N, Xis C-R, Xis C, and Xis CH, (2) Xis C, X, Xand Xare N, and Xis CH, (3) Xis C, Xand Xare N, Xand Xare CH, or (4) Xis C, Xis C-R, X, Xand Xare N; Ris a hydrogen atom or the like; and Y is an amino group or the like.【課題】PDE10阻害活性を有する新規化合物、又はその薬理的に許容し得る塩の提供。【解決手段】式〔I〕:〔式中、環Aは、含窒素へテロアリール等;環Bは、脂肪族単環式基等;X1~X5は、(1)X1およびX3がN、X2がC-R1、X4がC、X5がCH、(2)X1がC、X2、X3およびX4がN、X5がCH、(3)X1がC、X2およびX4がN、X3及びX5がCH、または(4)X1がC、X2がC-R1、X3、X4およびX5がN;R1は、水素原子等;Yは、アミノ基等、をそれぞれ示す。〕で示される化合物またはその薬理的に許容し得る塩。【選択図】なし