The correct option is D YX
X:ns2np5 electronegative element has total 7 valence electrons so, it will have a tendency to accept one electron and complete its octet. So, its valency =−1.
Y: electropositive alkali metal have one valence electron, so it has a tendency to loose one electron and complete its octet. So its valency =+1.
Y→Y++e−Y+X+e−→X−X−} have inert gas configuration
The compound is Y+X−.