The present invention relates to a compound represented by the formula:wherein W is C(R1) or N, each A is an optionally substituted aryl group or a heteroaryl group, X1 is -NR3-Y1-, -O-, -S-, -SO-, -SO2 or -CHR3- wherein R3 is a hydrogen atom or an optionally substituted aliphatic hydrocarbon group, or R3 is optionally bonded to A to form an optionally substituted ring structure, R1 is a hydrogen atom or an optionally substituted group bonded via a carbon atom, a nitrogen atom or an oxygen atom, R2 is a hydrogen atom or optionally substituted group bonded via a carbon atom or a sulfur atom, or R1 and R2, or R2 and R3 are optionally bonded to form an optionally substituted ring structure, or a salt thereof, and a tyrosine kinase inhibitor or an agent for the prophylaxis or treatment of cancer, which contains this compound or a prodrug thereof.