A diatomic molecule is a molecule composed of two atoms of the same or different elements. So the answer is no, a diatomic molecule does not have to be composed of only 2 different elements. Examples of diatomic molecules include hydrogen (H2), oxygen (O2), and carbon monoxide (CO).