Absolutely right!
18 g of water is equivalent to 1 mole of water, since the molar mass of water is 18 g/mol.
= By looking at the formula, in 1 mole of water, there are 2 moles of hydrogen atoms and 1 mole of oxygen atoms.