The invention provides an inhibitor of acetylcholine esterase and cholinesterase shown in the general formula (I), wherein R1, R2 and N form an aliphatic heterocyclic ring with 3-7 carbons containing 1-2 hetero atoms, and X is selected from a covalent bond, CH2, CH2CH2, CH2CH2CH2, CH2CH2CH2CH2, and C[(CH2)mCH3]2 (m=5). The compound shows inhibitory activities to acetylcholine esterase and cholinesterase, and can be used for treating and / or preventing cognitive diseases and neurodegeneration diseases.