To provide a compound having an inhibitory activity for an androgen receptor. A fused pyrimidine compound represented by the following formula (I) or a pharmaceutically acceptable thereof (in the formula, X, Y, Z, R1, and R2 are as defined in the specification) .