A compound of formula or a pharmaceutically acceptable salt thereof, wherein, w is n=0, 1, or 2; m=1, 2, or 3; each of Y 1, Y 3, and Y 4 is independently selected from the group consisting of-O-, -S-, -C 2 -, -N -, -S(=O) 2 -, -S(=O)-, -C(=O)-, and -C(=S)-; Y 2 is -O-, -S-, -N -, -S(=O) 2 -, -S(=O)-, -C(=O)- or -C(=S)-; X 1 is CR x1, or N; X 2 is CR X2, or N; X 3 is CR X3, or N; each of R X1, R X2, R X3 is independently selected from H, F, Cl, Br, I, CN, OH, SH, or NH 2, or each of R X1, R X2, R X3 is independently selected from the group consisting of C 1-6 alkyl and C 1-6 heteroalkyl, and the aforesaid group is optionally substituted by 1, 2, 3, or 4 R(s), R 1 is H, F, Cl, Me, CN, or CF 3; R 2 is R 02, OR 02, or SR 02; R 02 is independently selected from the group consisting of C 1-4 alkyl, C 1-4 heteroalkyl, and C 3-5 cycloalkyl-(CH 2) 0-3 -, and the aforesaid group is optionally substituted by 1, 2, 3, or 4 R(s); R 3 is selected from the group consisting of C 1-6 alkyl, C 1-6 heteroalkyl, C 2-4 alkynyl, 3 to 7 membered cycloalkyl, 3 to 7 membered cycloalkyl-L-, 3 to 7 membered heterocycloalkyl, 3 to 7 membered heterocycloalkyl-L-, each of which is optionally substituted by 1, 2, 3, or 4 R(s); L is selected from -O-, -S-, -C(=O)-, -S(=O) 2 -, or -S(=O)-, or L is selected from the group consisting of NH, C 1-4 alkyl, and C 1-4 heteroalkyl, and the aforesaid group is optionally substituted by 1, 2, 3, or 4 R(s); the "hetero" represents a heteroatom or a hetero-atomic group, which is selected from -C(=O)NH-, -NH-, -O-, -S-, N, =O, =S, -C(=O)O-, -C(=O)-, -C(=S)-, -S(=O)-, or -S(=O) 2 -; the number of the heteroatom or the hetero-atomic group is independently selected from 0, 1, 2, or 3; R is selected from H, F, Cl, Br, I, OH, or CN, or R is selected from the group consisting of NH 2, C 1-4 alkyl, C 1-4 heteroalkyl, 3 to 7 membered cycloalkyl, and 3 to 7 membered heterocycloalkyl, and the aforesaid group is optionally substituted by 1, 2, 3, or 4 R'(s); R' is selected from F, Cl, Br, I, CN, OH, NH 2, CF 3, NHCH 3, CH 2 OCH 3, or N(CH 3) 2. w is n=0, 1, or 2; m=1, 2, or 3; each of Y 1, Y 3, and Y 4 is independently selected from the group consisting of-O-, -S-, -C 2 -, -N -, -S(=O) 2 -, -S(=O)-, -C(=O)-, and -C(=S)-; Y 2 is -O-, -S-, -N -, -S(=O) 2 -, -S(=O)-, -C(=O)- or -C(=S)-; X 1 is CR x1, or N; X 2 is CR X2, or N; X 3 is CR X3, or N; each of R X1, R X2, R X3 is independently selected from H, F, Cl, Br, I, CN, OH, SH, or NH 2, or each of R X1, R X2, R X3 is independently selected from the group consisting of C 1-6 alkyl and C 1-6 heteroalkyl, and the aforesaid group is optionally substituted by 1, 2, 3, or 4 R(s), R 1 is H, F, Cl, Me, CN, or CF 3; R 2 is R 02, OR 02, or SR 02; R 02 is independently selected from the group consisting of C 1-4 alkyl, C 1-4 heteroalkyl, and C 3-5 cycloalkyl-(CH 2) 0-3 -, and the aforesaid group is optionally substituted by 1, 2, 3, or 4 R(s); R 3 is selected from the group consisting of C 1-6 alkyl, C 1-6 heteroalkyl, C 2-4 alkynyl, 3 to 7 membered cycloalkyl, 3 to 7 membered cycloalkyl-L-, 3 to 7 membered heterocycloalkyl, 3 to 7 membered heterocycloalkyl-L-, each of which is optionally substituted by 1, 2, 3, or 4 R(s); L is selected from -O-, -S-, -C(=O)-, -S(=O) 2 -, or -S(=O)-, or L is selected from the group consisting of NH, C 1-4 alkyl, and C 1-4 heteroalkyl, and the aforesaid group is optionally substituted by 1, 2, 3, or 4 R(s); the "hetero" represents a heteroatom or a hetero-atomic group, which is selected from -C(=O)NH-, -NH-, -O-, -S-, N, =O, =S, -C(=O)O-, -C(=O)-, -C(=S)-, -S(=O)-, or -S(=O) 2 -; the number of the heteroatom or the hetero-atomic group is independently selected from 0, 1, 2, or 3; R is selected from H, F, Cl, Br, I, OH, or CN, or R is selected from the group consisting of NH 2, C 1-4 alkyl, C 1-4 heteroalkyl, 3 to 7 membered cycloalkyl, and 3 to 7 membered heterocycloalkyl, and the aforesaid group is optionally substituted by 1, 2, 3, or 4 R'(s); R' is selected from F, Cl, Br, I, CN, OH, NH 2, CF 3, NHCH 3, CH 2 OCH 3, or N(CH 3) 2.