#include <bits/stdc++.h>
using namespace std;
bool mycomp(string a, string b) { return a.size() < b.size(); }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  vector<string> mys;
  string S;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> S;
    mys.push_back(S);
  }
  sort(mys.begin(), mys.end(), mycomp);
  for (int i = 1; i <= n - 1; i++) {
    for (int j = 0; j < i; j++) {
      size_t found = mys[i].find(mys[j]);
      if (found == string::npos) {
        cout << "NO"
             << "\n";
        return 0;
      }
    }
  }
  cout << "YES\n";
  for (vector<string>::iterator it = mys.begin(); it != mys.end(); it++) {
    cout << *it << "\n";
  }
  return 0;
}
