#include <bits/stdc++.h>
using namespace std;
bool compare(string a, string b) { return a.length() < b.length(); }
int main(int argc, const char* argv[]) {
  vector<string> v;
  string str;
  bool flag = false;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> str;
    v.push_back(str);
  }
  sort(v.begin(), v.end(), compare);
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      if (v[i] == v[j]) continue;
      if (v[j].find(v[i]) == string::npos) {
        flag = true;
        break;
      }
    }
  }
  if (flag) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      cout << v[i] << endl;
    }
  }
  return 0;
}
