A compound of Formula or a pharmaceutically acceptable salt thereof; wherein X is CR 7 or N; Z is CR 3 or N; R 1 is selected from the group consisting of cyano and a 5- to 10-membered heteroaryl which contains 1 to 5 heteroatoms independently selected from N, O and S; wherein the 5- to 10-membered heteroaryl is optionally substituted with 1 to 3 R 8; R 1a and R 1b are each independently hydrogen, halo, hydroxy or C 1 -C 3 alkyl; or R 1a and R 1b taken together with the carbon to which they are attached are a C 3 -C 6 cycloalkyl or C; R 2 is a C 1 -C 6 alkyl, C 3 -C 7 cycloalkyl or a 4- to 7-membered heterocycloalkyl which contains 1 to 3 heteroatoms independently selected from NR, O and S; wherein the C 3 -Cycycloalkyl and 4- to 7-membered heterocycloalkyl are each optionally substituted with 1 to 3 R 9; and wherein the C 1 -C 6 alkyl is optionally substituted with 1 to 3 R 10; R is hydrogen, C 1 -C 6 alkyl or absent; R 3, R 4, R 5, R 6 and R 7 are each independently selected from the group consisting of hydrogen, deutero, amino, halo, hydroxy, cyano, C 1 -C 6 alkyl, C 3 -C 6 cycloalkyl and C 1 -C 6 alkoxy; wherein the C 1 -C 6 alkyl, C 3 -C 6 cycloalkyl and C 1 -C 6 alkoxy are each optionally substituted with 1 to 3 halo or C 1 -C 3 alkoxy; R 8 at each occurrence is independently selected from the group consisting of halo, -C NH 2, -C NH(C 1 -C 3 alkyl), -C N(C 1 -C 3 alkyl) 2, C 1 -C 6 alkyl, C 1 -C 6 alkoxy and C 3 -C 6 cycloalkyl; wherein the C 1 -C 6 alkyl, C 1 -C 6 alkoxy and C 3 -C 6 cycloalkyl are each optionally substituted with 1 to 3 halo, cyano, hydroxy or C 1 -C 3 alkoxy; R 9 at each occurrence is independently selected from the group consisting of halo, hydroxy, C 1 -C 6 alkyl, C 1 -C 6 alkoxy, and C 1 -C 6 alkoxyC 1 -C 6 alkyl, wherein the C 1 -C 6 alkyl, C 1 -C 6 alkoxy, and C 1 -C 6 alkoxyC 1 -C 6 alkyl are optionally substituted with one to three halo or a cyano; and R 10 at each occurrence is independently selected from the group consisting of halo, C 1 -C 6 alkoxy, C 1 -C 6 thioalkoxy, amino, C 1 -C 6 alkylamino and di(C 1 -C 6 alkyl)amino. X is CR 7 or N; Z is CR 3 or N; R 1 is selected from the group consisting of cyano and a 5- to 10-membered heteroaryl which contains 1 to 5 heteroatoms independently selected from N, O and S; wherein the 5- to 10-membered heteroaryl is optionally substituted with 1 to 3 R 8; R 1a and R 1b are each independently hydrogen, halo, hydroxy or C 1 -C 3 alkyl; or R 1a and R 1b taken together with the carbon to which they are attached are a C 3 -C 6 cycloalkyl or C; R 2 is a C 1 -C 6 alkyl, C 3 -C 7 cycloalkyl or a 4- to 7-membered heterocycloalkyl which contains 1 to 3 heteroatoms independently selected from NR, O and S; wherein the C 3 -Cycycloalkyl and 4- to 7-membered heterocycloalkyl are each optionally substituted with 1 to 3 R 9; and wherein the C 1 -C 6 alkyl is optionally substituted with 1 to 3 R 10; R is hydrogen, C 1 -C 6 alkyl or absent; R 3, R 4, R 5, R 6 and R 7 are each independently selected from the group consisting of hydrogen, deutero, amino, halo, hydroxy, cyano, C 1 -C 6 alkyl, C 3 -C 6 cycloalkyl and C 1 -C 6 alkoxy; wherein the C 1 -C 6 alkyl, C 3 -C 6 cycloalkyl and C 1 -C 6 alkoxy are each optionally substituted with 1 to 3 halo or C 1 -C 3 alkoxy; R 8 at each occurrence is independently selected from the group consisting of halo, -C NH 2, -C NH(C 1 -C 3 alkyl), -C N(C 1 -C 3 alkyl) 2, C 1 -C 6 alkyl, C 1 -C 6 alkoxy and C 3 -C 6 cycloalkyl; wherein the C 1 -C 6 alkyl, C 1 -C 6 alkoxy and C 3 -C 6 cycloalkyl are each optionally substituted with 1 to 3 halo, cyano, hydroxy or C 1 -C 3 alkoxy; R 9 at each occurrence is independently selected from the group consisting of halo, hydroxy, C 1 -C 6 alkyl, C 1 -C 6 alkoxy, and C 1 -C 6 alkoxyC 1 -C 6 alkyl, wherein the C 1 -C 6 alkyl, C 1 -C 6 alkoxy, and C 1 -C 6 alkoxyC 1 -C 6 alkyl are optionally substituted with one to three halo or a cyano; and R 10 at each occurrence is independently selected from the group consisting of halo, C 1 -C 6 alkoxy, C 1 -C 6 thioalkoxy, amino, C 1 -C 6 alkylamino and di(C 1 -C 6 alkyl)amino.