Disclosed is a compound represented by the formula (I) below, which has aglucokinase-activating effect and is thus useful for treatment of diabetes orobesity, or a pharmaceutically acceptable salt thereof. [In the formula, R1represents an aryl or the like; R11 represents an aryl or the like; R2represents a formyl or the like; R3 represents a C1-6 alkyl or the like; R4represents a hydrogen atom or the like; Z1 represents -O- or the like; Z2represents -O- or the like; Y1-Y4 respectively represent a carbon atom or anitrogen atom; ring A represents a heteroaryl group; X represents a carbonatom or the like; m represents an integer of 0-2; and q represents an integerof 0-2.]