This invention is directed to compounds of formula (I): where, n, m, Y, R1,R2, R3, R4 and R5 are disclosed herein,as isolated stereoisomers or mixtures thereof, or as pharmaceuticallyacceptable salts thereof; pharmaceutical compositionscomprising the compounds of formula (I); and methods of using the compoundsand the pharmaceutical compositions in treatingdiseases or conditions associated with JAK2 activity.