A compound of formula wherein X is-CH 2 -CH 2 -CH 2 -, -CH=CH-CH=CH-, -CH 2 -CH 2 -CH 2 -CH 2 -, -CH 2 -O-CH 2 -CH 2 -, CH 2 -CH 2 -O-CH 2 -, -CH 2 -NR 2 -CH 2 -CH 2 -, or -CH 2 -CH 2 -NR 2 -CH 2 -; n is 0, 1 or 2; each R 1 is independently selected from halo, C 1-7 alkyl, C 2-7 alkenyl, hydroxy, C 1-7 alkoxy, NR 10 R 11, and CONR 10 R 11; wherein C 1-7 alkyl and C 1-7 alkoxy are optionally substituted by one or more C 1-7 alkyl, hydroxy, C 1-7 alkoxy, NR 10 R 11 or COR 9; R 2 is H, C 1-7 alkyl, hydroxy-C 1-7 alkyl, COR 9, CONR 10 R 11, or SO 2 -C 1-7 alkyl; Y 1 is N, CH or CCH 3, Y 2 is N or CR 3; with the proviso that not both of Y 1 and Y 2 are N; R 3 is H, halogen, C 1-7 alkyl, halo-C 1-7 alkyl, CONR 10 R 11 or CO-C 1-7 alkoxy; R 4 is H or C 1-7 alkyl, wherein C 1-7 alkyl is optionally substituted with one or more R 5; each R 5 is independently selected from hydroxy, C 1-7 alkoxy, NR 12 R 13, COR 9, CONR 10 R 11, SO 2 -C 1-7 alkyl, SO 2 -NR 10 R 11, heterocycloalkyl and heteroaryl; wherein C 1-7 alkoxy is optionally substituted by COR 9 or CONR 10 R 11; wherein heterocycloalkyl and heteroaryl are optionally substituted with one or more substituents selected from halo, C 1-7 alkyl, halo-C 1-7 alkyl, hydroxy, C 1-7 alkoxy, oxo, COR 9, C 1-7 alkyl-COR 9 or NR 10 R 11; Z 1 is N, CH or CO-CH 3; Z 2 is N or CH; R 6 is C 1-7 alkyl, hydroxy-C 1-7 alkyl, halo-C 1-7 alkyl, C 1-7 alkoxy-C 1-7 alkyl, C 1-7 alkoxy, halo-C 1-7 alkoxy, C 1-7 alkoxy-C 1-7 alkoxy, S-halo-C 1-7 alkyl, SF 5, C 3-7 cycloalkyl, heterocycloalkyl or heterocycloalkyl substituted by C 1-7 alkyl; R 7 is H, halogen or C 1-7 alkyl; R 8 is H, halogen or C 1-7 alkyl; R 9 is H, C 1-7 alkyl, hydroxy, or C 1-7 alkoxy; R 10 is H or C 1-7 alkyl; wherein C 1-7 alkyl is optionally substituted with one or more hydroxy, C 1-7 alkoxy, COOH, or CO-C 1-7 alkoxy; R 11 is H, C 1-7 alkyl, CO-C 1-7 alkoxy or heterocycloalkyl; wherein C 1-7 alkyl is optionally substituted with one or more hydroxy, C 1-7 alkoxy, NH 2, N(C 1-7 alkyl) 2, COOH, or CO-C 1-7 alkoxy; or R 10 and R 11 together with the interconnecting nitrogen form a heterocycloalkyl which is optionally substituted with one ore more halo, C 1-7 alkyl, halo-C 1-7 alkyl, hydroxy, C 1-7 alkoxy, oxo, COOH, CO-C 1-7 alkoxy or NH 2; R 12 is H or C 1-7 alkyl; wherein C 1-7 alkyl is optionally substituted with one or more hydroxy, C 1-7 alkoxy, COOH, or CO-C 1-7 alkoxy; R 13 is H, C 1-7 alkyl, CO-C 1-7 alkoxy or heterocycloalkyl, wherein C 1-7 alkyl is optionally substituted with one or more hydroxy, C 1-7 alkoxy, NH 2, N(C 1-7 alkyl) 2, COOH, or CO-C 1-7 alkoxy; or a pharmaceutically acceptable salt thereof. X is-CH 2 -CH 2 -CH 2 -, -CH=CH-CH=CH-, -CH 2 -CH 2 -CH 2 -CH 2 -, -CH 2 -O-CH 2 -CH 2 -, CH 2 -CH 2 -O-CH 2 -, -CH 2 -NR 2 -CH 2 -CH 2 -, or -CH 2 -CH 2 -NR 2 -CH 2 -; n is 0, 1 or 2; each R 1 is independently selected from halo, C 1-7 alkyl, C 2-7 alkenyl, hydroxy, C 1-7 alkoxy, NR 10 R 11, and CONR 10 R 11; wherein C 1-7 alkyl and C 1-7 alkoxy are optionally substituted by one or more C 1-7 alkyl, hydroxy, C 1-7 alkoxy, NR 10 R 11 or COR 9; R 2 is H, C 1-7 alkyl, hydroxy-C 1-7 alkyl, COR 9, CONR 10 R 11, or SO 2 -C 1-7 alkyl; Y 1 is N, CH or CCH 3, Y 2 is N or CR 3; with the proviso that not both of Y 1 and Y 2 are N; R 3 is H, halogen, C 1-7 alkyl, halo-C 1-7 alkyl, CONR 10 R 11 or CO-C 1-7 alkoxy; R 4 is H or C 1-7 alkyl, wherein C 1-7 alkyl is optionally substituted with one or more R 5; each R 5 is independently selected from hydroxy, C 1-7 alkoxy, NR 12 R 13, COR 9, CONR 10 R 11, SO 2 -C 1-7 alkyl, SO 2 -NR 10 R 11, heterocycloalkyl and heteroaryl; wherein C 1-7 alkoxy is optionally substituted by COR 9 or CONR 10 R 11; wherein heterocycloalkyl and heteroaryl are optionally substituted with one or more substituents selected from halo, C 1-7 alkyl, halo-C 1-7 alkyl, hydroxy, C 1-7 alkoxy, oxo, COR 9, C 1-7 alkyl-COR 9 or NR 10 R 11; Z 1 is N, CH or CO-CH 3; Z 2 is N or CH; R 6 is C 1-7 alkyl, hydroxy-C 1-7 alkyl, halo-C 1-7 alkyl, C 1-7 alkoxy-C 1-7 alkyl, C 1-7 alkoxy, halo-C 1-7 alkoxy, C 1-7 alkoxy-C 1-7 alkoxy, S-halo-C 1-7 alkyl, SF 5, C 3-7 cycloalkyl, heterocycloalkyl or heterocycloalkyl substituted by C 1-7 alkyl; R 7 is H, halogen or C 1-7 alkyl; R 8 is H, halogen or C 1-7 alkyl; R 9 is H, C 1-7 alkyl, hydroxy, or C 1-7 alkoxy; R 10 is H or C 1-7 alkyl; wherein C 1-7 alkyl is optionally substituted with one or more hydroxy, C 1-7 alkoxy, COOH, or CO-C 1-7 alkoxy; R 11 is H, C 1-7 alkyl, CO-C 1-7 alkoxy or heterocycloalkyl; wherein C 1-7 alkyl is optionally substituted with one or more hydroxy, C 1-7 alkoxy, NH 2, N(C 1-7 alkyl) 2, COOH, or CO-C 1-7 alkoxy; or R 10 and R 11 together with the interconnecting nitrogen form a heterocycloalkyl which is optionally substituted with one ore more halo, C 1-7 alkyl, halo-C 1-7 alkyl, hydroxy, C 1-7 alkoxy, oxo, COOH, CO-C 1-7 alkoxy or NH 2; R 12 is H or C 1-7 alkyl; wherein C 1-7 alkyl is optionally substituted with one or more hydroxy, C 1-7 alkoxy, COOH, or CO-C 1-7 alkoxy; R 13 is H, C 1-7 alkyl, CO-C 1-7 alkoxy or heterocycloalkyl, wherein C 1-7 alkyl is optionally substituted with one or more hydroxy, C 1-7 alkoxy, NH 2, N(C 1-7 alkyl) 2, COOH, or CO-C 1-7 alkoxy;