The object of the present invention is to provide the compound with excellent CH24H inhibiting effect, as preventing or the prevention for the treatment of epilepsy, neurodegenerative disease etc. or therapeutic agent. The present invention relates to the compound or its salts representated by following formula, wherein each symbol is defined as in the description.本發明的目的是:提供具有優良的CH24H抑制作用的化合物,用作預防或治療癲癇、神經變性疾病等等的預防或治療劑。本發明涉及下式所代表的化合物或其鹽,其中,每個符號如說明書所定義。