Two metals X and Y belong to the second group of the periodic table. X forms insoluble oxide but soluble sulphate. Y forms a soluble oxide but insoluble sulphate. The hydroxide of metal X is soluble in NaOH while that of metal Y is insoluble in NaOH. What are metals X and Y?