A compound represented by the formula (I) or a pharmaceutically acceptable salt thereof: (I) wherein X
1
to X
4
independently represent a carbon atom or the like; the ring A represents a 5- to 6-membered heteroaryl having 1 to 4 heteroatoms independently selected from the group consisting of a nitrogen atom, a sulfur atom and an oxygen atom; X
5
represents an oxygen atom or the like; X represents a carbon atom or the like; Het represents a 5- or 6-membered aliphatic heterocycle; R
1
represents an aryl or the like; R
2
represents a formyl group or the like; and R
3
represents a —C
1-6
alkyl or the like. The compound or salt has a glucokinase activation effect and is useful as a therapeutic agent for diabetes.