This question is purely balancing the chemical equation where the number of atoms in reactants is equal to the number of atoms in products.
For the mentioned equation:
In the reactants, we have 2 atoms of Hg and 2 atoms of oxygen.
In the products, we should have 2 atoms of Hg and 2 atoms of oxygen.
Since the oxygen molecule is composed of 2 oxygen atoms, therefore the coefficient should be equal to 1 for the equation to be balanced.