Counting the yearly layers can date them. The oxygen in the water molecules also holds a key to past climate. Scientists are able to use the oxygen atoms in the glacial ice as a proxy for air temperature above the glacier.
The balanced equation will be 2HgO--->2Hg+O2