The present invention relates to a compound represented by the formula (I), which is useful as an agent for the prophylaxis or treatment of epilepsy, neurodegenerative disease and the like. In the formula (I), each symbol is as defined in the specification.