A compound of formula: or a salt thereof, wherein: A is N; L is NR 6; one of X 1, X 2, X 3, X 4 and X 5 is N and the others are CH; m is 1; n is 0 or 1; R 1 is hydrogen, C 1 -C 8 alkyl, C 2 -C 8 alkenyl, C 2 -C 8 alkynyl, alkoxyalkyl, hydroxyalkyl, imidazolyl, furylalkyl, pyridylalkyl, phenylalkyl, oxazolylalkyl, thienylalkyl, thiazolidinyl, isoindolyl, -C R e, dihydroindenyl, C 3 -C 8 cycloalkyl, C 3 -C 8 cycloalkylalkyl, piperidyl, morpholinyl, pyrrolidinyl, azetidinyl or piperazinyl, each of which is optionally substituted with 1-3 R 7; R 2 is phenyl, naphthyl, benzofuryl, indazolyl, benzothienyl, pyridyl, pyrimidinyl, dihydrobenzodioxinyl, benzodioxolyl, benzoimidazolyl, isoxazolyl, pyrazolyl, indolinyl or benzisoxazolyl, each of which is optionally substituted with 1-5 R 9; each R 3 or R 4 is independently hydrogen, C 1 -C 8 alkyl, halo, haloalkyl or -OR d; R 6 is hydrogen or C 1 -C 8 alkyl; each R 7 and R 9 is independently C 1 -C 8 alkyl, phenyl, halo, haloalkyl, haloalkoxy, hydroxyalkyl, alkoxyalkyl, oxo, -CN, -NO 2, -C OR a, -C NR b R b', -NR b R b', -OR d, -C R e or -S q R f, each of which is optionally substituted with 1-3 R 12; R 12 is independently C 1 -C 8 alkyl, oxo, halo, haloalkyl, -CN, -C NR b R b' or -C R e, each of which is optionally substituted with 1-3 R 13; R 13 is independently C 1 -C 8 alkyl, halo or pyrrolidinyl; q is 1 or 2; and each R a, R b, R b, R d, R e and R f is independently hydrogen, C 1 -C 8 alkyl, C 3 -C 8 cycloalkyl, pyrrolidinyl, piperidyl, morpholinyl, piperazinyl, tetrahydropyranyl, phenylalkyl, alkoxyalkyl, morpholinylalkyl, oxazolidinylalkyl, imidazolylalkyl, tetrahydropyranylalkyl, pyridylalkyl, pyrazolylalkyl, tetrazolylalkyl, thiazolylalkyl, pyrrolylalkyl, benzoxazolylalkyl, indazolylalkyl, dihydrobenzoxazinylalkyl, tetrahydrofurylalkyl, tetrahydrofuryl, alkylaminoalkyl, dialkylaminoalkyl or phenyl. A is N; L is NR 6; one of X 1, X 2, X 3, X 4 and X 5 is N and the others are CH; m is 1; n is 0 or 1; R 1 is hydrogen, C 1 -C 8 alkyl, C 2 -C 8 alkenyl, C 2 -C 8 alkynyl, alkoxyalkyl, hydroxyalkyl, imidazolyl, furylalkyl, pyridylalkyl, phenylalkyl, oxazolylalkyl, thienylalkyl, thiazolidinyl, isoindolyl, -C R e, dihydroindenyl, C 3 -C 8 cycloalkyl, C 3 -C 8 cycloalkylalkyl, piperidyl, morpholinyl, pyrrolidinyl, azetidinyl or piperazinyl, each of which is optionally substituted with 1-3 R 7; R 2 is phenyl, naphthyl, benzofuryl, indazolyl, benzothienyl, pyridyl, pyrimidinyl, dihydrobenzodioxinyl, benzodioxolyl, benzoimidazolyl, isoxazolyl, pyrazolyl, indolinyl or benzisoxazolyl, each of which is optionally substituted with 1-5 R 9; each R 3 or R 4 is independently hydrogen, C 1 -C 8 alkyl, halo, haloalkyl or -OR d; R 6 is hydrogen or C 1 -C 8 alkyl; each R 7 and R 9 is independently C 1 -C 8 alkyl, phenyl, halo, haloalkyl, haloalkoxy, hydroxyalkyl, alkoxyalkyl, oxo, -CN, -NO 2, -C OR a, -C NR b R b', -NR b R b', -OR d, -C R e or -S q R f, each of which is optionally substituted with 1-3 R 12; R 12 is independently C 1 -C 8 alkyl, oxo, halo, haloalkyl, -CN, -C NR b R b' or -C R e, each of which is optionally substituted with 1-3 R 13; R 13 is independently C 1 -C 8 alkyl, halo or pyrrolidinyl; q is 1 or 2; and each R a, R b, R b, R d, R e and R f is independently hydrogen, C 1 -C 8 alkyl, C 3 -C 8 cycloalkyl, pyrrolidinyl, piperidyl, morpholinyl, piperazinyl, tetrahydropyranyl, phenylalkyl, alkoxyalkyl, morpholinylalkyl, oxazolidinylalkyl, imidazolylalkyl, tetrahydropyranylalkyl, pyridylalkyl, pyrazolylalkyl, tetrazolylalkyl, thiazolylalkyl, pyrrolylalkyl, benzoxazolylalkyl, indazolylalkyl, dihydrobenzoxazinylalkyl, tetrahydrofurylalkyl, tetrahydrofuryl, alkylaminoalkyl, dialkylaminoalkyl or phenyl.