The present invention provides a therapeutic agent useful in the treatment and/or prevention of conditions, including cancer, caused by enhanced OPN production, the therapeutic agent containing a compound represented by the formula (in the formula, R1, R2, R3, R4, R5, R6, R7, m, n, p, X, and Y are as defined in the specification) or a pharmaceutically acceptable salt thereof.