A compound of Formula Ia or Ib or a pharmaceutically acceptable salt thereof, wherein, n is 1, 2, or 3; alk is -O-(CH 2) 2-4 *; wherein * indicates the point of attachment to R 1; R 1 is heterocyclyl; R 2 is an unsubstituted C 1-4 alkoxy; R 3 is H; R 4 is alkyl, cycloalkyl, aryl, OR d, or NR e R f; R d is hydrogen, alkyl, haloalkyl, hydroxyalkyl, alkoxyalkyl, cycloalkyl, halocycloalkyl, cycloalkylalkyl, aryl, aralkyl, heteroaryl, heteroaralkyl, heterocyclyl, or heterocyclylalkyl; R e is hydrogen or alkyl; R f is hydrogen, alkyl, deuterated alkyl, alkylthioalkyl, acyl, haloalkyl, hydroxyalkyl, alkoxyalkyl, aminoalkyl, cyanoalkyl, carboxyalkyl, alkoxycarbonylalkyl, cycloalkyl, cycloalkylalkyl, aryl, aralkyl, heteroaryl, heteroaralkyl, heterocyclyl, or heterocyclylalkyl; wherein the cycloalkyl, the aryl, the heteroaryl, and the heterocyclyl either alone or as part of the cycloalkylalkyl, the aralkyl, the heteroaralkyl and the heterocyclylalkyl in R d and R f are independently unsubstituted or substituted with 1, 2, or 3 of R g, R h, and R i wherein R g, R h, and R i are independently selected from alkyl, hydroxy, alkoxy, halo, haloalkyl, cyano, carboxy, alkoxycarbonyl, and haloalkoxy, and wherein the alkylene of the aralkyl, the heteroaralkyl, the heterocyclylalkyl, and the cycloalkylalkyl in R d and R f is optionally substituted with one to nine deuteriums; and ring B is a 5-, 6-, or 7-membered nitrogen containing heterocyclyl that is optionally substituted with 1 to 4 substituents independently selected from C 1-4 alkyl. n is 1, 2, or 3; alk is -O-(CH 2) 2-4 *; wherein * indicates the point of attachment to R 1; R 1 is heterocyclyl; R 2 is an unsubstituted C 1-4 alkoxy; R 3 is H; R 4 is alkyl, cycloalkyl, aryl, OR d, or NR e R f; R d is hydrogen, alkyl, haloalkyl, hydroxyalkyl, alkoxyalkyl, cycloalkyl, halocycloalkyl, cycloalkylalkyl, aryl, aralkyl, heteroaryl, heteroaralkyl, heterocyclyl, or heterocyclylalkyl; R e is hydrogen or alkyl; R f is hydrogen, alkyl, deuterated alkyl, alkylthioalkyl, acyl, haloalkyl, hydroxyalkyl, alkoxyalkyl, aminoalkyl, cyanoalkyl, carboxyalkyl, alkoxycarbonylalkyl, cycloalkyl, cycloalkylalkyl, aryl, aralkyl, heteroaryl, heteroaralkyl, heterocyclyl, or heterocyclylalkyl; wherein the cycloalkyl, the aryl, the heteroaryl, and the heterocyclyl either alone or as part of the cycloalkylalkyl, the aralkyl, the heteroaralkyl and the heterocyclylalkyl in R d and R f are independently unsubstituted or substituted with 1, 2, or 3 of R g, R h, and R i wherein R g, R h, and R i are independently selected from alkyl, hydroxy, alkoxy, halo, haloalkyl, cyano, carboxy, alkoxycarbonyl, and haloalkoxy, and wherein the alkylene of the aralkyl, the heteroaralkyl, the heterocyclylalkyl, and the cycloalkylalkyl in R d and R f is optionally substituted with one to nine deuteriums; and ring B is a 5-, 6-, or 7-membered nitrogen containing heterocyclyl that is optionally substituted with 1 to 4 substituents independently selected from C 1-4 alkyl. wherein the cycloalkyl, the aryl, the heteroaryl, and the heterocyclyl either alone or as part of the cycloalkylalkyl, the aralkyl, the heteroaralkyl and the heterocyclylalkyl in R d and R f are independently unsubstituted or substituted with 1, 2, or 3 of R g, R h, and R i wherein R g, R h, and R i are independently selected from alkyl, hydroxy, alkoxy, halo, haloalkyl, cyano, carboxy, alkoxycarbonyl, and haloalkoxy, and wherein the alkylene of the aralkyl, the heteroaralkyl, the heterocyclylalkyl, and the cycloalkylalkyl in R d and R f is optionally substituted with one to nine deuteriums; and ring B is a 5-, 6-, or 7-membered nitrogen containing heterocyclyl that is optionally substituted with 1 to 4 substituents independently selected from C 1-4 alkyl.