A compound having the formula (Ia): or a tautomer or a pharmaceutically acceptable salt thereof, wherein: Y 1b is CH or C; Z 1b is heterocyclyl, -NR 4d SO 2 - or heterocyclylsulfonyl, R 1b is selected from the group consisting of (a) H, (b) C 1-8 alkyl, optionally substituted with amino, aminoC 1-8 alkyl, aminocarbonyl, C 1-8 alkoxy, C 1-8 alkylaminocarbonyl, aminoC 1-8 alkylene, aminoC 1-8 alkoxy, aryl, hydroxy or heterocyclyl, (c) C 3-8 cycloalkyl, optionally subsitituted with alkyl, amino, hydroxyl, C 1-8 alkoxy, aminoC 1-8 alkylene, aminoC 1-8 alkoxy; (d) aryl, optionally substituted with alkyl, amino, aminosulfonyl, aminoC 1-8 alkylene, C 1-8 alkylaminocarbonylC 1-8 alkoxy, hydroxyl, C 1-8 alkoxy, C 1-8 alkylaminocarbonyl, aminoC 1-8 alkylene, aminoC 1-8 alkoxy or halo; (e) heterocyclyl, optionally substituted with C 1-8 alkyl, C 1-8 alkoxycarbonyl, amino, hydroxyl, C 1-8 alkoxy, C 1-8 alkylaminocarbonyl, aminoC 1-8 alkylene, aminoC 1-8 alkoxy, oxo, or cyanoC 1-8 alkylenecarbonyl; (f) heteroaryl, optionally subsitituted with alkyl, amino, hydroxyl, C 1-8 alkoxy, C 1-8 alkylaminocarbonyl, aminoC 1-8 alkylene or aminoC 1-8 alkoxy; R 4b is selected from the group consisting of H, hydroxy, C 1-8 alkylcarbonyl-, C 1-8 alkoxycarbonylC 1-8 alkylene, C 1-8 alkoxycarbonylamino, aminocarbonylC 1-8 alkylene, hydroxycarbonyl, hydroxycarbonylC 1-8 alkylene, aminocarbonyl, aminoC 1-8 alkylene, hydroxyC 1-8 alkylenecarbonylamino, C 1-8 alkylaminoC 1-8 alkylene, C 1-8 alkylaminoC 1-8 alkyleneaminocarbonyl, aminocarbonylamino, C 1-8 alkylsulfonylC 1-8 alkylene, C 3-8 cycloalkylcarbonylamino and C 1-8 alkylcarbonylamino; and R 4c is H, amino, C 1-8 alkylcarbonyl, or aminocarbonylC 1-8 alkoxy; R 4d is H or C 1-8 alkyl; R 5 is H or C 1-8 alkyl; R 6 is selected from the group consisting of H, C 1-8 alkyl, halo, hydroxy and oxo; R 7 is selected from the group consisting of H, cyano, C 1-8 alkoxyC 1-8 alkylene, C 1-8 alkylcarbonyl, hydroxy, oxo, halo, aryl and heteroaryl; and the dashed line indicates a double or single bond; or the moiety R 4b -Z 1b combines with R 4c to form 5-7 membered heterocyclic ring, containing 1-3 heteroatoms, including N, O, S, optionally substituted with C 1-8 alkyl, halo, cyano, oxo, =S, amino, hydroxyl, C 1-8 alkylcarbonyl, C 1-8 alkoxy or aryloxycarbonylC 1-8 alkylene. Y 1b is CH or C; Z 1b is heterocyclyl, -NR 4d SO 2 - or heterocyclylsulfonyl, R 1b is selected from the group consisting of (a) H, (b) C 1-8 alkyl, optionally substituted with amino, aminoC 1-8 alkyl, aminocarbonyl, C 1-8 alkoxy, C 1-8 alkylaminocarbonyl, aminoC 1-8 alkylene, aminoC 1-8 alkoxy, aryl, hydroxy or heterocyclyl, (c) C 3-8 cycloalkyl, optionally subsitituted with alkyl, amino, hydroxyl, C 1-8 alkoxy, aminoC 1-8 alkylene, aminoC 1-8 alkoxy; (d) aryl, optionally substituted with alkyl, amino, aminosulfonyl, aminoC 1-8 alkylene, C 1-8 alkylaminocarbonylC 1-8 alkoxy, hydroxyl, C 1-8 alkoxy, C 1-8 alkylaminocarbonyl, aminoC 1-8 alkylene, aminoC 1-8 alkoxy or halo; (e) heterocyclyl, optionally substituted with C 1-8 alkyl, C 1-8 alkoxycarbonyl, amino, hydroxyl, C 1-8 alkoxy, C 1-8 alkylaminocarbonyl, aminoC 1-8 alkylene, aminoC 1-8 alkoxy, oxo, or cyanoC 1-8 alkylenecarbonyl; (f) heteroaryl, optionally subsitituted with alkyl, amino, hydroxyl, C 1-8 alkoxy, C 1-8 alkylaminocarbonyl, aminoC 1-8 alkylene or aminoC 1-8 alkoxy; (a) H, (b) C 1-8 alkyl, optionally substituted with amino, aminoC 1-8 alkyl, aminocarbonyl, C 1-8 alkoxy, C 1-8 alkylaminocarbonyl, aminoC 1-8 alkylene, aminoC 1-8 alkoxy, aryl, hydroxy or heterocyclyl, (c) C 3-8 cycloalkyl, optionally subsitituted with alkyl, amino, hydroxyl, C 1-8 alkoxy, aminoC 1-8 alkylene, aminoC 1-8 alkoxy; (d) aryl, optionally substituted with alkyl, amino, aminosulfonyl, aminoC 1-8 alkylene, C 1-8 alkylaminocarbonylC 1-8 alkoxy, hydroxyl, C 1-8 alkoxy, C 1-8 alkylaminocarbonyl, aminoC 1-8 alkylene, aminoC 1-8 alkoxy or halo; (e) heterocyclyl, optionally substituted with C 1-8 alkyl, C 1-8 alkoxycarbonyl, amino, hydroxyl, C 1-8 alkoxy, C 1-8 alkylaminocarbonyl, aminoC 1-8 alkylene, aminoC 1-8 alkoxy, oxo, or cyanoC 1-8 alkylenecarbonyl; (f) heteroaryl, optionally subsitituted with alkyl, amino, hydroxyl, C 1-8 alkoxy, C 1-8 alkylaminocarbonyl, aminoC 1-8 alkylene or aminoC 1-8 alkoxy; R 4b is selected from the group consisting of H, hydroxy, C 1-8 alkylcarbonyl-, C 1-8 alkoxycarbonylC 1-8 alkylene, C 1-8 alkoxycarbonylamino, aminocarbonylC 1-8 alkylene, hydroxycarbonyl, hydroxycarbonylC 1-8 alkylene, aminocarbonyl, aminoC 1-8 alkylene, hydroxyC 1-8 alkylenecarbonylamino, C 1-8 alkylaminoC 1-8 alkylene, C 1-8 alkylaminoC 1-8 alkyleneaminocarbonyl, aminocarbonylamino, C 1-8 alkylsulfonylC 1-8 alkylene, C 3-8 cycloalkylcarbonylamino and C 1-8 alkylcarbonylamino; and R 4c is H, amino, C 1-8 alkylcarbonyl, or aminocarbonylC 1-8 alkoxy; R 4d is H or C 1-8 alkyl; R 5 is H or C 1-8 alkyl; R 6 is selected from the group consisting of H, C 1-8 alkyl, halo, hydroxy and oxo; R 7 is selected from the group consisting of H, cyano, C 1-8 alkoxyC 1-8 alkylene, C 1-8 alkylcarbonyl, hydroxy, oxo, halo, aryl and heteroaryl; and the dashed line indicates a double or single bond; or the moiety R 4b -Z 1b combines with R 4c to form 5-7 membered heterocyclic ring, containing 1-3 heteroatoms, including N, O, S, optionally substituted with C 1-8 alkyl, halo, cyano, oxo, =S, amino, hydroxyl, C 1-8 alkylcarbonyl, C 1-8 alkoxy or aryloxycarbonylC 1-8 alkylene.