Yes. Diatomic elements exist as molecules with the basic formula #"X"_2"#, where #"X"# represents the element, and #"X"_2"# represents a molecule consisting of two #"X"# atoms covalently bonded. Therefore, the molar mass for one #"X"# atom is doubled when determining the molar mass of the molecule #"X"_2#.
For example, a molecule of hydrogen gas has the formula #"H"_2"#, which means it consists of two hydrogen atoms covalently bonded. The molar mass of a single hydrogen atom is 1 g/mol. The molar mass of a hydrogen molecule is 2 x 1 g/mol = 2 g/mol.
Likewise, a molecule of oxygen gas has the formula #"O"_2#. The molar mass of a single oxygen atom is 16 g/mol. The molar mass of an #"O"_2# molecule is 2 x 16g/mol = 32 g/mol.
Note: Given molar masses have been rounded to a whole number.