The effects of interstitial atoms in rare earth (R) intermetallic compounds are: strong increase in Curie temperature, weak increase of saturation magnetization and large influence in the crystalline electric field (CEF) at the R atom. These effects are more remarkable in carbide and nitride compounds than in hydrides. In this paper we will show that additional effects concerning the transition metals (T) occur. In YFe10.5Mo1.5, with ThMn12-type structure, it is shown that the introduction of H or N leads, also to an increase of both the Curie temperature and Fe moment. The most remarkable effect is that whereas with hydrogen we observe an increase of the easy c-axis anisotropy, with nitrogen the anisotropy becomes easy plane.