Answer is: yes, because the ratios of grams and moles would be similiar.
For example, molecule of water:
1) M(H₂O) = 2Ar(H) + Ar(O) · g/mol.
M(H₂O) = 2 + 16 · g/mol.
M(H₂O) = 18 g/mol; molar mass of water
Ratio grams and moles is 18 : 1.
2) if we write molar mass as ratio mole and grams (1 mol/18 g), ratio is of grams and moles is still the same 18 : 1.