A gas X is passed through water to form a saturated solution. The aqueous solution on treatment with silver nitrate gives a white precipitate. The saturated aqueous solution also dissolves magnesium ribbon with evolution of a colourless gas Y. Identify X and Y :