The present invention provides an ±,²-unsaturated amide compound or a pharmaceutically acceptable salt or the like thereof having anticancer activity and the like represented by the following formula (I): [wherein, "A" represents optionally substituted heterocyclic diyl, R 1 represents hydrogen atom or optionally substituted lower alkyl, R 2 represents optionally substituted aryl, optionally substituted cycloalkyl, optionally substituted aliphatic heterocyclic group or optionally substituted aromatic heterocyclic group, X represents -O-, -S-, -SO 2 -, -NR X1 - (wherein, R X1 represents hydrogen atom or lower alkyl), -CHR X2 - (wherein, R X2 represents hydrogen atom or hydroxy), -CH=CH-, -CO- or -NH-CO-, and n1 and n2 are the same or different, and each represents 0 or 1].