#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  pair<int, string> p[n];
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    p[i].first = s.length();
    p[i].second = s;
  }
  sort(p, p + n);
  for (int i = 0; i < n - 1; i++) {
    bool is = false;
    int sz = p[i + 1].second.length();
    for (int j = 0; j < sz - p[i].second.length() + 1; j++) {
      string s = p[i + 1].second.substr(j, p[i].second.length());
      if (s == p[i].second) {
        is = true;
        break;
      }
    }
    if (is) continue;
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) cout << p[i].second << endl;
}
