A compound represented by the formula (I), an optically active isomer thereof, or a pharmaceutical acceptable salt thereof: wherein X represents CH or N; represents a C1-C12 alkyl; R2 represents a hydrogen atom, or the like; R′ represents a C1-C6 alkyl or the like; q represents 0 or an integer of 1 to 7; Y represents a C1-C6 alkyl or the like; p represents 0 or an integer of 1 to 5; R represents a 2,3-dihydroindolyl or the like, which is used for preventive and/or therapeutic treatment of a disease caused by tau protein kinase 1 hyperactivity such as a neurodegenerative diseases (e.g. Alzheimer disease).