The problem of the present invention is to provide a compound having a PDE2A inhibitory action, and useful as a prophylactic or therapeutic drug for schizophrenia, Alzheimers disease and the like. The present invention relates to a compound represented by the formula (I):wherein each symbol is as described in the DESCRIPTION, or a salt thereof.