A compound having the formula: and pharmaceutically acceptable salts thereof, wherein: A is C 1 -C 4 alkylene, C 2 -C 4 alkenylene, C 3 -C 7 cycloalkyl, 5 or 6-membered monocyclic heteroaryl, 4 to 7-membered heterocycloalkyl, arylene, -O-, -NH-C -, -C NH-or -C -; the group -X-Y- is -O-CH 2; m is 1; each occurrence of n is independently 0 or 1; R a is H or C 1 -C 6 alkyl; R b is H or C 1 -C 6 alkyl; R 1 is H or C 1 -C 6 alkyl, which is optionally substituted with up to three R 3 groups; each occurrence of R 2 is independently selected from H, C 1 -C 6 alkyl, C 3 -C 7 cycloalkyl, halo, C 1 -C 6 haloalkyl, -C R 6, - C N(R 6) 2 and -NHC R 6; each occurrence of R 3 is independently selected from C 3 -C 7 cycloalkyl, 5 or 6-membered monocyclic heteroaryl, 4 to 6-membered monocyclic heterocycloalkyl, C 6 -C 10 aryl, halo, C 1 -C 6 haloalkyl, -OR 6, -N(R 6) 2, -C R 6, -C N(R 6) 2, -NHC R 6 and -SR 6, wherein said C 3 -C 7 cycloalkyl group, said 5 or 6-membered monocyclic heteroaryl group, said 4 to 6-membered monocyclic heterocycloalkyl group and said C 6 -C 10 aryl group can each be optionally and independently substituted with one or more groups, each independently selected from C 1 -C 6 alkyl, C 3 -C 7 cycloalkyl, 5 or 6-membered monocyclic heteroaryl, 4 to 6-membered monocyclic heterocycloalkyl, C 6 -C 10 aryl, halo, C 1 -C 6 haloalkyl, -OR 6, -N(R 6) 2, -C R 6, - C OR 6,-C N(R 6) 2, -NHC R 6 and -SR 6; R 4 is C 1 -C 6 alkyl, C 3 -C 7 cycloalkyl or C 6 -C 10 aryl, wherein said C 3 -C 7 cycloalkyl group and said C 6 -C 10 aryl group can be optionally substituted with one or more groups, each independently selected from C 1 -C 6 alkyl, C 3 -C 7 cycloalkyl, C 6 -C 10 aryl, halo, C 1 -C 6 haloalkyl,-C R 6, - C OR 6, - C N(R 6) 2, -NHC R 6 and -S 2 R 6; R 5 is selected from C 1 -C 6 alkyl, -(C 1 -C 3 alkylene) n -(C 3 -C 7 cycloalkyl), -(C 1 -C 3 alkylene) n -(5 or 6-membered monocyclic heteroaryl), -(C 1 -C 3 alkylene) n -(4 to 6-membered monocyclic heterocycloalkyl) and -(C 1 -C 3 alkylene) n -(C 6 -C 10 aryl), wherein said C 3 -C 7 cycloalkyl group, said 5 or 6-membered monocyclic heteroaryl group, said 4 to 6-membered monocyclic heterocycloalkyl group and said C 6 -C 10 aryl group can each be optionally and independently substituted with one or more groups, each independently selected from C 1 -C 6 alkyl, C 3 -C 7 cycloalkyl, 5 or 6-membered monocyclic heteroaryl, 4 to 6-membered monocyclic heterocycloalkyl, C 6 -C 10 aryl, halo, C 1 -C 6 haloalkyl,, -OR 6, -N(R 6) 2, -C R 6, - C N(R 6) 2,-NHC R 6, -S 2 R 6 and -SR 6; and each occurrence of R 6 is independently selected from H, C 1 -C 6 alkyl, C 3 -C 7 cycloalkyl, C 6 -C 10 aryl and benzyl. A is C 1 -C 4 alkylene, C 2 -C 4 alkenylene, C 3 -C 7 cycloalkyl, 5 or 6-membered monocyclic heteroaryl, 4 to 7-membered heterocycloalkyl, arylene, -O-, -NH-C -, -C NH-or -C -; the group -X-Y- is -O-CH 2; m is 1; each occurrence of n is independently 0 or 1; R a is H or C 1 -C 6 alkyl; R b is H or C 1 -C 6 alkyl; R 1 is H or C 1 -C 6 alkyl, which is optionally substituted with up to three R 3 groups; each occurrence of R 2 is independently selected from H, C 1 -C 6 alkyl, C 3 -C 7 cycloalkyl, halo, C 1 -C 6 haloalkyl, -C R 6, - C N(R 6) 2 and -NHC R 6; each occurrence of R 3 is independently selected from C 3 -C 7 cycloalkyl, 5 or 6-membered monocyclic heteroaryl, 4 to 6-membered monocyclic heterocycloalkyl, C 6 -C 10 aryl, halo, C 1 -C 6 haloalkyl, -OR 6, -N(R 6) 2, -C R 6, -C N(R 6) 2, -NHC R 6 and -SR 6, wherein said C 3 -C 7 cycloalkyl group, said 5 or 6-membered monocyclic heteroaryl group, said 4 to 6-membered monocyclic heterocycloalkyl group and said C 6 -C 10 aryl group can each be optionally and independently substituted with one or more groups, each independently selected from C 1 -C 6 alkyl, C 3 -C 7 cycloalkyl, 5 or 6-membered monocyclic heteroaryl, 4 to 6-membered monocyclic heterocycloalkyl, C 6 -C 10 aryl, halo, C 1 -C 6 haloalkyl, -OR 6, -N(R 6) 2, -C R 6, - C OR 6,-C N(R 6) 2, -NHC R 6 and -SR 6; R 4 is C 1 -C 6 alkyl, C 3 -C 7 cycloalkyl or C 6 -C 10 aryl, wherein said C 3 -C 7 cycloalkyl group and said C 6 -C 10 aryl group can be optionally substituted with one or more groups, each independently selected from C 1 -C 6 alkyl, C 3 -C 7 cycloalkyl, C 6 -C 10 aryl, halo, C 1 -C 6 haloalkyl,-C R 6, - C OR 6, - C N(R 6) 2, -NHC R 6 and -S 2 R 6; R 5 is selected from C 1 -C 6 alkyl, -(C 1 -C 3 alkylene) n -(C 3 -C 7 cycloalkyl), -(C 1 -C 3 alkylene) n -(5 or 6-membered monocyclic heteroaryl), -(C 1 -C 3 alkylene) n -(4 to 6-membered monocyclic heterocycloalkyl) and -(C 1 -C 3 alkylene) n -(C 6 -C 10 aryl), wherein said C 3 -C 7 cycloalkyl group, said 5 or 6-membered monocyclic heteroaryl group, said 4 to 6-membered monocyclic heterocycloalkyl group and said C 6 -C 10 aryl group can each be optionally and independently substituted with one or more groups, each independently selected from C 1 -C 6 alkyl, C 3 -C 7 cycloalkyl, 5 or 6-membered monocyclic heteroaryl, 4 to 6-membered monocyclic heterocycloalkyl, C 6 -C 10 aryl, halo, C 1 -C 6 haloalkyl,, -OR 6, -N(R 6) 2, -C R 6, - C N(R 6) 2,-NHC R 6, -S 2 R 6 and -SR 6; and each occurrence of R 6 is independently selected from H, C 1 -C 6 alkyl, C 3 -C 7 cycloalkyl, C 6 -C 10 aryl and benzyl.