Disclosed is a compound of Formula IIa, IIb, IIc, IId, IIe, IIf, or IIg e.g. 3-(cyanomethyl)-3-[4-(2-{ [3-(2-oxopyrrolidin-1-yl)phenyl]amino} pyrimidin-4-yl)-1H-pyrazol-1-yl]cyclobutanecarbonitrile, or pharmaceutically acceptable salt thereof, wherein Ring A is aryl or heteroaryl and the other the substitiuents are defined in the specification for treating rheumatoid arthritis, psoriasis and polycythemia vera (PV), essential thrombocythemia (ET), myeloid metaplasia with myelofibrosis (MMM), chronic myelogenous leukemia (CML), chronic myelomonocytic leukemia (CMML), hypereosinophilic syndrome (HES), idiopathic myelofibrosis (IMF), or systemic mast cell disease (SMCD).