A compound of formula or a pharmaceutically acceptable salt thereof, wherein p is 1 or 2; ----- is a single or double bond; R 1 is m is 0, 1, or 2; one of X and X' is N and the other is CH; R 2, and R 3 are independently selected from hydrogen, alkoxy, alkyl, aryl, halo, and heteroaryl, wherein the aryl and heteroaryl are optionally substituted with one group independently selected from alkoxy and alkyl; R 2 is hydrogen; R x is selected from methyl and ethyl; R y and R z are independently selected from hydrogen and hydroxy; provided that when ----- is a double bond, R y and R z are each hydrogen; R 4 is selected from hydrogen, alkyl, and halo, haloalkoxy, haloalkyl, and hydroxyalkyl; R 5 is selected from hydrogen, alkoxyalkoxycarbonyl, alkoxycarbonyl, alkylaminocarbonyl, alkylcarbonyl, cycloalkylalkoxycarbonyl, cycloalkylcarbonyl, cycloalkyloxycarbonyl, deuteroalkoxycarbonyl, deuterohaloalkoxycarbonyl, dialkylaminocarbonyl, dialkylaminocarbonylcarbonyl, haloalkoxycarbonyl, haloalkylaminocarbonyl, haloalkylcarbonyl, heterocyclylcarbonyl, heterocyclyloxycarbonyl, phenylcarbonyl, and phenyloxycarbonyl, wherein the cycloalkyl part of the cycloalkylalkoxycarbonyl, the cycloalkylcarbonyl, and the cycloalkyloxycarbonyl, the heterocyclyl part of the heterocyclylcarbonyl and the heterocyclyloxycarbonyl, and the phenyl part of the phenylcarbonyl and the phenyloxycarbonyl, is optionally substituted with one, two, or three groups independently selected from alkyl, alkylamino, alkylcarbonyl, cycloalkyl, dialkylamino, halo, haloalkoxy, and haloalkyl; and one of Y and Y' is CH 2 and the other is selected from CH 2 and O wherein heteroaryl refers to refers to an aromatic five- or six-membered ring where at least one atom is selected from N, O, and S, and the remaining atoms are carbon or bicyclic systems where a heteroaryl ring is fused to a four- to six-membered aromatic or non-aromatic ring containing zero, one, or two additional heteroatoms selected from N, O, and S; and heterocyclyl refers to a cyclic, non-aromatic, saturated or partially unsaturated five-, six-, or seven-membered ring where at least one atom is selected from oxygen, nitrogen, and sulfur or bicyclic systems where a heterocyclyl ring is fused to a four-to six-membered aromatic or non-aromatic carbocyclic ring or a four- to six-membered non-aromatic ring containing zero, one, or two additional heteratoms selected from nitrogen, oxygen, and sulfur. p is 1 or 2; ----- is a single or double bond; R 1 is m is 0, 1, or 2; one of X and X' is N and the other is CH; R 2, and R 3 are independently selected from hydrogen, alkoxy, alkyl, aryl, halo, and heteroaryl, wherein the aryl and heteroaryl are optionally substituted with one group independently selected from alkoxy and alkyl; R 2 is hydrogen; R x is selected from methyl and ethyl; R y and R z are independently selected from hydrogen and hydroxy; provided that when ----- is a double bond, R y and R z are each hydrogen; R 4 is selected from hydrogen, alkyl, and halo, haloalkoxy, haloalkyl, and hydroxyalkyl; R 5 is selected from hydrogen, alkoxyalkoxycarbonyl, alkoxycarbonyl, alkylaminocarbonyl, alkylcarbonyl, cycloalkylalkoxycarbonyl, cycloalkylcarbonyl, cycloalkyloxycarbonyl, deuteroalkoxycarbonyl, deuterohaloalkoxycarbonyl, dialkylaminocarbonyl, dialkylaminocarbonylcarbonyl, haloalkoxycarbonyl, haloalkylaminocarbonyl, haloalkylcarbonyl, heterocyclylcarbonyl, heterocyclyloxycarbonyl, phenylcarbonyl, and phenyloxycarbonyl, wherein the cycloalkyl part of the cycloalkylalkoxycarbonyl, the cycloalkylcarbonyl, and the cycloalkyloxycarbonyl, the heterocyclyl part of the heterocyclylcarbonyl and the heterocyclyloxycarbonyl, and the phenyl part of the phenylcarbonyl and the phenyloxycarbonyl, is optionally substituted with one, two, or three groups independently selected from alkyl, alkylamino, alkylcarbonyl, cycloalkyl, dialkylamino, halo, haloalkoxy, and haloalkyl; and one of Y and Y' is CH 2 and the other is selected from CH 2 and O