#include <bits/stdc++.h>
using namespace std;
class TaskB {
 public:
  void solve(std::istream &in, std::ostream &out) {
    int n;
    in >> n;
    string s;
    pair<int, string> p[n];
    for (int i = 0; i < n; ++i) {
      in >> s;
      p[i] = make_pair(s.length(), s);
    }
    sort(p, p + n);
    bool flag = true;
    for (int i = 0; i < n - 1; ++i) {
      if (p[i + 1].second.find(p[i].second) == string::npos) {
        flag = false;
        break;
      }
    }
    if (flag) {
      out << "YES" << endl;
      for (int i = 0; i < n; ++i) out << p[i].second << endl;
    } else
      out << "NO" << endl;
  }
};
int main() {
  TaskB solver;
  std::istream &in(std::cin);
  std::ostream &out(std::cout);
  solver.solve(in, out);
  return 0;
}
