The present invention provides a compound which has the effect of PDE 10A inhibition, and which is useful as a medicament for preventing or treating schizophrenia or so on. A compound represented by the formula (1&prime): wherein, Ring A&prime represents an optionally substituted pyridine ring, an optionally substituted pyridazine ring, a pyrimidine ring, or 10 a pyrazine ring, R1&prime represents (1) wherein, R1a&prime represents an optionally substituted phenyl group, or an optionally substituted 5- to 10-membered heterocyclic group, Ring B2 represents a bond, &mdashS&mdash, -0-, &mdashCO&mdash, an optionally substituted methylene group, or &mdashNRa&prime&mdash (Ra&prime represents a hydrogen atom, or an optionally substituted C1-6 alkyl group), and Ring B1&prime represents an optionally further substituted 6- to 10-membered aromatic hydrocarbon ring, or an optionally further substituted 5- to 10-membered aromatic heterocyclic ring, or alternatively, L&prime and R1a&prime may be taken together to form an optionally substituted bicyclic or tricyclic fused heterocyclic group, or (2), wherein, R1b&prime represents an optionally substituted phenyl group, or an optionally substituted 5- to 10-membered heterocyclic group, Ring B2&prime represents an optionally substituted benzene ring, an optionally substituted pyridine ring, an optionally substituted pyrimidine ring, an optionally substituted pyrazine ring, or an optionally substituted pyridazine ring, Ring D&prime represents an optionally further substituted 5- or 6-membered ring, R2&prime represents a hydrogen atom, or a substituent, X&prime represents &boxHN&mdash or &boxHCRb&prime&mdash(Rb&prime represents a hydrogen atom, or a substituent), - - - - - represents that Rb&prime and R2&prime may form, taken together with the carbon atom and the nitrogen atom to which they are each adjacent, an optionally substituted 5- to 7-membered ring when.X&prime is &boxHCRb&prime, or a salt thereof.