The law of conservation of mass states that in any closed system the mass of the system is neither created nor destroyed over time i.e, the mass cannot be changed overtime.
We know that, elements in the same group of the periodic table have similar characteristics. Here magnesium and strontium are the same 2nd group elements and have same behavior.