Provided is a compound which has an outstanding GPR119 agonist action. Specifically, a compound represented by general formula (I) or a pharmaceutically permitted salt thereof is provided. (I) [In formula (I), substituent group A represents phenyl or a 5 or 6-membered heteroaryl, W represents a single bond, -O-, -NH-, -OCH2- or -CH2O-, X represents a nitrogen atom or CR21, Y1 represents a nitrogen atom or CR22, Y2 represents a nitrogen atom or CR23, Y3 represents a nitrogen atom or CR24, R21, R22, R23 and R24 which can be the same or different represent a hydrogen atom or C1-6 alkyl, and substituent group B represents (a) C2-6 alkyl, C3-8 cycloalkyl, (C3-8 cycloalkyl)C1-6 alkyl, (aryl)C1-6 alkyl or (saturated heterocyclyl)C1-6 alkyl, (b) -COOR31 (R31 represents C1-6 alkyl, C3-8 cycloalkyl, aryl or saturated heterocyclyl), or (c) 5 or 6-membered heteroaryl represented by general formula (ss). However, a structure represented by formula (A) is excluded.]