Provided are compounds having excellent TAFIa inhibitory activity. Specifically, a compound represented by the following formula (I) or a salt thereof is provided. In the formula, A represents a benzene ring or a pyridine ring; X represents a formula — (CH 2) —, a formula — (CH 2) 2 —, an oxygen atom, a nitrogen atom or a single bond, and Y represents a formula — ( CH2) 3-NH-R3, formula-(CH2) 4-NH-R3, or 2-aminopyridyl group; R3 represents a hydrogen atom or the like; R1 represents a hydrogen atom or the like; R2 represents CO2R8 or the like Or a tetrazolyl group; R8 represents a hydrogen atom, a C1-10 alkyl group or a structure represented by the following formulas Ib and Ic; m and n each represents an integer of 0 or 1;優れたTAFIa阻害活性を有する化合物を提供する。具体的には、下記式(I)で表される化合物又はその塩を提供する。ただし、式中Aは、ベンゼン環又はピリジン環を示し;Xは、式-(CH2)-、式-(CH2)2-、酸素原子、窒素原子又は単結合を示し、Yは、式-(CH2)3-NH-R3、式-(CH2)4-NH-R3、又は2-アミノピリジル基を示し;R3は、水素原子等を示し;R1は水素原子等を示し;R2は、CO2R8等又はテトラゾリル基を示し;R8は、水素原子、C1-10アルキル基、又は下記式Ib,Icの構造で表されるものを示し;m、nは、0又は1の整数を示す。