A compound having the formula: or a pharmaceutically acceptable salt thereof, wherein: B is: X is O, N, S or CH 2; R 1 is is H, C 1 -C 3 alkyl, C 2 -C 3 alkenyl or C 2 -C 3 alkynyl; R 2 is -N(R 6) 2; R 3 is H, C 6 -C 20 alkyl, -(C 1 -C 3 alkylene) m- (C 3 -C 7 cycloalkyl) or -(C 1 -C 3 alkylene) m- (C 6 -C 10 aryl); wherein said C 6 -C 20 alkyl group, said C 3 -C 7 cycloalkyl group and said C 6 -C 10 aryl group can be optionally substituted with up to five groups, each independently selected from C 1 -C 6 alkyl, C 2 -C 6 alkenyl, C 2 -C 6 alkynyl, C 3 -C 7 cycloalkyl, C 6 -C 10 aryl, 5- or 6-membered monocyclic heteroaryl, 9- or 10-membered bicyclic heteroaryl, halo, -OR 7, -SR 7,-S R 7, -S 2 R 7, -S 2 N(R 7) 2, C 1 -C 6 haloalkyl, C 1 -C 6 hydroxyalkyl, -O-(C 1 -C 6 haloalkyl),-CN, -NO 2, -N(R 7) 2, -C OR 7, -C N(R 7) 2 and -NHC R 7, -NHC OR 7 and-NHC N(R 7) 2; each occurrence of R 4 is independently H, C 1 -C 6 alkyl, C 1 -C 6 haloalkyl, C 1 -C 6 hydroxyalkyl, -(C 1 -C 3 alkylene) m- (C 3 -C 7 cycloalkyl), -(C 1 -C 3 alkylene) m -(C 6 -C 10 aryl), -(C 1 -C 3 alkylene) m -(4 to 7-membered heterocycloalkyl), -(C 1 -C 3 alkylene) m -(5- or 6-membered monocyclic heteroaryl) or -(C 1 -C 3 alkylene) m -(9- or 10-membered bicyclic heteroaryl); R 5 is H or -C -(C 1 -C 20 alkyl); each occurrence of R 6 is independently H, C 1 -C 6 alkyl, C 3 -C 7 cycloalkyl, phenyl or benzyl; each occurrence of R 7 is independently H, C 1 -C 10 alkyl, C 1 -C 6 haloalkyl, C 1 -C 6 hydroxyalkyl, -(C 1 -C 3 alkylene) m- (C 3 -C 7 cycloalkyl), -(C 1 -C 3 alkylene) m- (C 6 -C 10 aryl), -(C 1 -C 3 alkylene) m -(4 to 7-membered heterocycloalkyl), -(C 1 -C 3 alkylene) m -(5- or 6-membered monocyclic heteroaryl) or -(C 1 -C 3 alkylene) m -(9- or 10-membered bicyclic heteroaryl), wherein said C 3 -C 7 cycloalkyl group, said C 6 -C 10 aryl group, said 4 to 7-membered heterocycloalkyl group, said -5- or 6-membered monocyclic heteroaryl group or said 9- or 10-membered bicyclic heteroaryl group can be optionally substituted with R 8; R 8 represents from one to five substituent groups, each independently selected from C 1 -C 6 alkyl, C 2 -C 6 alkenyl, C 2 -C 6 alkynyl, halo, -OR 4, -SR 4, C 1 -C 6 haloalkyl, C 1 -C 6 hydroxyalkyl, -O-(C 1 -C 6 haloalkyl), -CN, -NO 2, -N(R 4) 2, -C OR 4, -C N(R 4) 2 and-NHC R 4; and each occurrence of m is independently 0 or 1. B is: X is O, N, S or CH 2; R 1 is is H, C 1 -C 3 alkyl, C 2 -C 3 alkenyl or C 2 -C 3 alkynyl; R 2 is -N(R 6) 2; R 3 is H, C 6 -C 20 alkyl, -(C 1 -C 3 alkylene) m- (C 3 -C 7 cycloalkyl) or -(C 1 -C 3 alkylene) m- (C 6 -C 10 aryl); wherein said C 6 -C 20 alkyl group, said C 3 -C 7 cycloalkyl group and said C 6 -C 10 aryl group can be optionally substituted with up to five groups, each independently selected from C 1 -C 6 alkyl, C 2 -C 6 alkenyl, C 2 -C 6 alkynyl, C 3 -C 7 cycloalkyl, C 6 -C 10 aryl, 5- or 6-membered monocyclic heteroaryl, 9- or 10-membered bicyclic heteroaryl, halo, -OR 7, -SR 7,-S R 7, -S 2 R 7, -S 2 N(R 7) 2, C 1 -C 6 haloalkyl, C 1 -C 6 hydroxyalkyl, -O-(C 1 -C 6 haloalkyl),-CN, -NO 2, -N(R 7) 2, -C OR 7, -C N(R 7) 2 and -NHC R 7, -NHC OR 7 and-NHC N(R 7) 2; each occurrence of R 4 is independently H, C 1 -C 6 alkyl, C 1 -C 6 haloalkyl, C 1 -C 6 hydroxyalkyl, -(C 1 -C 3 alkylene) m- (C 3 -C 7 cycloalkyl), -(C 1 -C 3 alkylene) m -(C 6 -C 10 aryl), -(C 1 -C 3 alkylene) m -(4 to 7-membered heterocycloalkyl), -(C 1 -C 3 alkylene) m -(5- or 6-membered monocyclic heteroaryl) or -(C 1 -C 3 alkylene) m -(9- or 10-membered bicyclic heteroaryl); R 5 is H or -C -(C 1 -C 20 alkyl); each occurrence of R 6 is independently H, C 1 -C 6 alkyl, C 3 -C 7 cycloalkyl, phenyl or benzyl; each occurrence of R 7 is independently H, C 1 -C 10 alkyl, C 1 -C 6 haloalkyl, C 1 -C 6 hydroxyalkyl, -(C 1 -C 3 alkylene) m- (C 3 -C 7 cycloalkyl), -(C 1 -C 3 alkylene) m- (C 6 -C 10 aryl), -(C 1 -C 3 alkylene) m -(4 to 7-membered heterocycloalkyl), -(C 1 -C 3 alkylene) m -(5- or 6-membered monocyclic heteroaryl) or -(C 1 -C 3 alkylene) m -(9- or 10-membered bicyclic heteroaryl), wherein said C 3 -C 7 cycloalkyl group, said C 6 -C 10 aryl group, said 4 to 7-membered heterocycloalkyl group, said -5- or 6-membered monocyclic heteroaryl group or said 9- or 10-membered bicyclic heteroaryl group can be optionally substituted with R 8; R 8 represents from one to five substituent groups, each independently selected from C 1 -C 6 alkyl, C 2 -C 6 alkenyl, C 2 -C 6 alkynyl, halo, -OR 4, -SR 4, C 1 -C 6 haloalkyl, C 1 -C 6 hydroxyalkyl, -O-(C 1 -C 6 haloalkyl), -CN, -NO 2, -N(R 4) 2, -C OR 4, -C N(R 4) 2 and-NHC R 4; and each occurrence of m is independently 0 or 1.