Provided is a novel compound having BTK inhibitory action and a cell proliferation suppressing effect. Also provided is a medicine useful for the prevention and/or treatment of a disease associated with BTK, particularly cancer, based on BTK inhibitory action. A compound represented by formula (I) [wherein R 1 to R 3 , W, A, Y and Z respectively have the meanings as defined in the specification], or a salt thereof is disclosed.本發明提供一種具有BTK抑制作用,且具有細胞增生抑制效果之新穎化合物。又,本發明提供一種基於BTK抑制作用而對與該BTK相關之疾病、尤其是癌之預防及/或治療有用之醫藥。本發明係一種化合物或其鹽,該化合物係以式(I)[式中,R1~R3、W、A、Y、及Z具有如說明書中所定義之含義]表示。