Provided is a compound having a cholinergic muscarinic M1 receptor positive allosteric modulator activity, and useful as a prophylactic or therapeutic drug for Alzheimer's disease, schizophrenia, pain, sleep disorder and the like. The present invention relates to a compound represented by the formula wherein ring A is a 4- to 7-membered ring optionally having substituent (s) ; L is -O-, -S-, -SO- or -SO 2 -; R 1 is a C 1-6 alkyl group optionally having substituent(s) (provided that when L is -O-, R 1 is not a C 1-6 alkyl group optionally substituted by halogen atom(s)), or a cyclic group optionally having substituent(s); X 1 is -CRa= or -N=; X 2 is -CRb= or -N=; X 3 is-CRc= or -N=; Ra, Rb and Rc are each a C 1-6 alkyl group, C 2-6 alkenyl group, C 1-6 alkoxy group, C 3-6 cycloalkyl group, C 3-6 cycloalkoxy group or C 6-14 aryl group, each of which optionally having substituent(s), H or halogen, or a salt thereof.