Yes. You use different molar masses for each hydrated form. The molar mass of copper sulfate pentahydrate is somewhere around 250g/mol (I think, double check that) and the molar mass of copper sulfate anhydrous is around 160g/mol. The difference is five times the molar mass of water,
5 * 18 = 90
160 + 90 = 250.