#include <bits/stdc++.h>
using namespace std;
string rec[104];
bool cmp(string a, string b) {
  if (a.size() == b.size()) {
    return a < b;
  } else {
    return a.size() < b.size();
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> rec[i];
  }
  sort(rec, rec + n, cmp);
  bool fl = 1;
  for (int i = 1; i < n; i++) {
    if (rec[i].size() == rec[i - 1].size()) {
      if (rec[i] != rec[i - 1]) fl = 0;
    } else {
      if (rec[i].find(rec[i - 1]) == string::npos) {
        fl = 0;
      }
    }
  }
  if (!fl)
    cout << "NO";
  else {
    cout << "YES\n";
    for (int i = 0; i < n; i++) {
      cout << rec[i] << endl;
    }
  }
  return 0;
}
