The present invention provides a compound represented by the formula (1): wherein each symbol is as defined in the specification, or a salt thereof, a prodrug of the compound or a salt thereof, a medicament containing the compound or a salt thereof, the medicament which is a phosphodiesterase 10A inhibitor, and a medicament which is for preventing or treating schizophrenia.