We have studied the structural and electronic properties of YN in rock salt (sodium chloride), caesium chloride, zinc blende and wurtzite structures using first-principles total energy calculations. Rock salt is the calculated ground state structure with a = 4.93 Å, B0 = 157 GPa. The experimental lattice constant is a = 4.877 Å. There is an additional local minimum in the wurtzite structure with total energy 0.28 eV/unit cell higher. At high pressure (∼ 138 GPa), our calculations predict a phase transformation from a NaCl to a CsCl structure.