The correct option is B Be and O
The atomic number of Beryllium (Be) is 4 and its electronic configuration is 2, 2. Hence, it will lose two electrons to acquire a duplet and show a valency of 2.
The atomic number of Oxygen (O) is 8 and its electronic configuration is 2, 6. Hence, it will gain two electrons to acquire an octet and show a valency of 2.
Hence, the correct answer is option (b).