The present invention provides substituted bicyclic heteroaryl compounds,5 including, for example, 4-pyrazoIyI-N-arylpyrirnidin-2-arnines and 4-pyrazolyl-N-heteroarylpyτimidin-2-aminesthat modulate the activity of kinases and are useful in the treatment of diseasesrelated to activity of kinases including, for example, immune-related diseases,skin disorders, myeloid proliferative disorders, cancer, and other diseases.formule:(1)