A compound of formula: or a pharmaceutically acceptable salt thereof, wherein: A is selected from: m is 0 or 1; n is 1; R 1 is a) phenyl, or b) a phenyl bonded to the parent molecular moiety and fused to a second ring selected from the group consisting of a 5- or 6-membered heteroaryl, a 5- to 6-membered heterocycle containing 1-2 oxygen atoms, and a second phenyl, or c) a 5- or 6- membered heteroaryl having 1, 2, or 3 heteroatoms independently selected from N, O, and S, wherein R 1 is unsubstituted or substituted with 1, 2, or 3 substituents independently selected from the group consisting of halo, C 1 -C 4 alkyl, C 1 -C 4 haloalkyl, -NHCOR e, and C 3 -C 6 cycloalkyl; R 2 is hydrogen; R 3 is selected from hydrogen and C 1 -C 4 alkyl; R 4 is selected from C 4 -C 6 alkyl and -(CR b R c) p -Y'; R 5 is hydrogen; Y' is selected from C 3 -C 10 cycloalkyl; C 3 -C 8 cycloalkenyl; phenyl; a phenyl bonded to the parent molecular moiety and fused to a 5- to 6-membered heterocycle containing 1-2 oxygen atoms; a 5- or 6-membered heteroaryl having 1, 2, or 3 nitrogen atoms; and a 5-, 6-, or 7-membered heterocycle containing 1 oxygen atom; wherein Y' is unsubstituted or substituted with one or two substituents independently selected from halo and C 1 -C 4 alkyl; each R b is hydrogen; each R c is hydrogen; R e is hydrogen or C 1 -C 4 alkyl; and p is 0, 1, 2, or 3. A is selected from: m is 0 or 1; n is 1; R 1 is a) phenyl, or b) a phenyl bonded to the parent molecular moiety and fused to a second ring selected from the group consisting of a 5- or 6-membered heteroaryl, a 5- to 6-membered heterocycle containing 1-2 oxygen atoms, and a second phenyl, or c) a 5- or 6- membered heteroaryl having 1, 2, or 3 heteroatoms independently selected from N, O, and S, wherein R 1 is unsubstituted or substituted with 1, 2, or 3 substituents independently selected from the group consisting of halo, C 1 -C 4 alkyl, C 1 -C 4 haloalkyl, -NHCOR e, and C 3 -C 6 cycloalkyl; a) phenyl, or b) a phenyl bonded to the parent molecular moiety and fused to a second ring selected from the group consisting of a 5- or 6-membered heteroaryl, a 5- to 6-membered heterocycle containing 1-2 oxygen atoms, and a second phenyl, or c) a 5- or 6- membered heteroaryl having 1, 2, or 3 heteroatoms independently selected from N, O, and S, R 2 is hydrogen; R 3 is selected from hydrogen and C 1 -C 4 alkyl; R 4 is selected from C 4 -C 6 alkyl and -(CR b R c) p -Y'; R 5 is hydrogen; Y' is selected from C 3 -C 10 cycloalkyl; C 3 -C 8 cycloalkenyl; phenyl; a phenyl bonded to the parent molecular moiety and fused to a 5- to 6-membered heterocycle containing 1-2 oxygen atoms; a 5- or 6-membered heteroaryl having 1, 2, or 3 nitrogen atoms; and a 5-, 6-, or 7-membered heterocycle containing 1 oxygen atom; wherein Y' is unsubstituted or substituted with one or two substituents independently selected from halo and C 1 -C 4 alkyl; each R b is hydrogen; each R c is hydrogen; R e is hydrogen or C 1 -C 4 alkyl; and R 5 is hydrogen; Y' is selected from C 3 -C 10 cycloalkyl; C 3 -C 8 cycloalkenyl; phenyl; a phenyl bonded to the parent molecular moiety and fused to a 5- to 6-membered heterocycle containing 1-2 oxygen atoms; a 5- or 6-membered heteroaryl having 1, 2, or 3 nitrogen atoms; and a 5-, 6-, or 7-membered heterocycle containing 1 oxygen atom; wherein Y' is unsubstituted or substituted with one or two substituents independently selected from halo and C 1 -C 4 alkyl; each R b is hydrogen; each R c is hydrogen; R e is hydrogen or C 1 -C 4 alkyl; and p is 0, 1, 2, or 3.