Disclosed is a substituted amide represented by formula (I), which is useful as an active ingredient of a pharmaceutical composition, especially as an active ingredient of a pharmaceutical composition for the treatment of diseases that are induced by lysophosphatidic acid (LPA). (In the formula, A represents an optionally substituted aryl group or the like; B represents an optionally substituted aromatic five-membered heterocyclic group; X represents a single bond or a -(CRR)- group; n represents 1, 2, 3 or 4; R and R each represents a hydrogen atom or the like; Y-Y each represents a CR group or N; R represents a hydrogen atom or the like; R and R each represents a hydrogen atom or the like; m represents 1, 2 or 3; R represents a hydrogen atom or the like; and R represents an optionally substituted lower alkyl group or the like.)