A thiazolylimidazole derivative representedby the formula(see formula I)or a pharmaceutically acceptable salt thereof, and anALK5 inhibitor, an therapeutic agent for alopecia or ahair growth agent having the above as an activeingredient,wherein:X1 and X2 are different from each other andrepresent a sulfur atom or a carbon atom; R1 representsa phenyl group; a substituted phenyl group; a phenylgroup condensed with a hetero aromatic ring; a pyridylgroup; or a pyridyl group condensed with a heteroaromatic ring; R2 represents a hydrogen atom, a halogenatom, an alkyl group having 1 to 6 carbon atoms, analkyl group having 1 to 6 carbon atoms substituted with1 to 5 halogen atoms, an alkoxy group having 1 to 6carbon atoms, an alkanoyl group having 1 to 5 carbonatoms, or a hydroxyalkyl group having 1 to 6 carbonatoms, A represents a group which is represented by theformula.(see formula II)The present invention provides an inhibitorysubstance against ALK5 which is a TGF-.beta. type I receptorand provides a hair growth stimulant or a hair growthagent based on its novel activities.