  We investigate energetically favorable structures of ABO$_2$N oxynitrides as
functions of pressure and strain via swarm-intelligence-based structure
prediction methods, DFT lattice dynamics and first-principles molecular
dynamics. We predict several thermodynamically stable polar oxynitride
perovskites under high pressures. In addition, we find that ferroelectric polar
phases of perovskite-structured oxynitrides can be thermodynamically stable and
synthesized at high pressure on appropriate substrates. The dynamical stability
of the ferroelectric oxynitrides under epitaxial strain at ambient pressure
also imply the possibility to synthesize them using pulsed laser deposition or
other atomic layer deposition methods. Our results have broad implications for
further exploration of other oxynitride materials as well. We performed
first-principles molecular dynamics and find that the polar perovskite of
YSiO$_2$N is metastable up to at least 600 K under compressive epitaxial strain
before converting to the stable wollastonite-like structures. YSiO$_2$N is
stabilized under pressure with extensional epitaxial strain. We predict that
LaSi$_2$N, LaGeO$_2$N, BiSiO$_2$N, and BiGeO$_2$N are metastable as
ferroelectric perovskites at zero pressure even without epitaxial strain.
