1. A compound of formula (I) or a pharmaceutically acceptable salt thereof: (wherein A 1 is a group selected from the group consisting of the following a) to c): a) C 6-10 aryl, wherein the ring is unsubstituted or substituted with 1 to 2 substituents independently selected from the group consisting of the following: a halogen atom, hydroxy, C 1-6 alkyl, C 1-6 alkoxy, halo-C 1-6 alkyl, halo-C 1-6 alkoxy, C 1-6 alkoxycarbonyl, cyano, hydroxy-C 1-6 alkyl, carbamoyl, nitro, amino, C 1-6 alkoxycarbonylamino-C 1-6 alkyl, mono(di)C 1-6 alkylamino, (C 1-6 alkyl)carbonylamino, C 1-6 alkylsulfonylamino and C 1-6 alkylsulfonyl, b) 5-membered heterocycle, wherein the ring is unsubstituted or substituted with 1 to 2 substituents independently selected from the group consisting of the following: a halogen atom, hydroxy, C 1-6 alkyl, C 1-6 alkoxy, halo-C 1-6 alkyl, cyano and halo-C 1-6 alkoxy, and c) 6-membered heterocycle, wherein the ring is unsubstituted or substituted with 1 to 2 substituents independently selected from the group consisting of the following: a halogen atom, hydroxy, C 1-6 alkyl, C 1-6 alkoxy, halo-C 1-6 alkyl, cyano and halo-C 1-6 alkoxy; A 2 is a group selected from the group consisting of the following d) to f): d) C 6-10 aryl, wherein the ring is unsubstituted or substituted with 1 to 2 substituents independently selected from the group consisting of the following: a halogen atom, hydroxy, C 1-6 alkyl, C 1-6 alkoxy, hydroxy-C 1-6 alkoxy, halo-C 1-6 alkyl, halo-C 1-6 alkoxy, cyano, amino, nitro, carboxy, (C 1-6 alkyl)carbonylamino, (C 1-6 alkyl)carbonyloxy, (C 1-6 alkyl)carbonyl and (C 7-10 aralkyloxy)carbonyl, e) heterocycle, wherein the ring is unsubstituted or substituted with 1 to 2 substituents independently selected from the group consisting of the following: a halogen atom, hydroxy, C 1-6 alkyl, C 1-6 alkoxy, halo-C 1-6 alkyl, halo-C 1-6 alkoxy, cyano, mono(di)C 1-6 alkylamino, C 1-6 alkylsulfanyl, amino, (C 7-10 aralkyloxy)carbonyl, hydroxy-C 1-6 alkyl, hydroxy-C 1-6 alkoxy, C 2-6 alkenyl, morpholino and (C 1-6 alkyl)carbonyl , and f) C 3-6 cycloalkyl; X is CH or N; Y is —CR 1 R 2 — or an oxygen atom; R 1 and R 2 independently represent a hydrogen atom, a halogen atom or C 1-6 alkyl; R 3 and R 4 independently represent a hydrogen atom, a halogen atom, C 1-6 alkyl, C 1-6 alkoxy, halo-C 1-6 alkyl, halo-C 1-6 alkoxy, hydroxy-C 1-6 alkoxy, C 3-6 cycloalkyl, C 3-6 cycloalkoxy, C 2-6 alkenyl or cyano with the proviso that when X is CH, and R 1 and R 2 are hydrogen atoms, R 3 and R 4 are not hydrogen atoms at the same time; and n is 1 or 2).