#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n;
  vector<pair<int, string> > s;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    string k;
    cin >> k;
    s.push_back(make_pair(k.length(), k));
  }
  bool ok = false;
  sort(s.begin(), s.end());
  for (i = 1; i < n; i++) {
    if (s[i].second.find(s[i - 1].second) != std::string::npos)
      continue;
    else {
      ok = true;
      break;
    }
  }
  if (!ok) {
    cout << "YES" << endl;
    for (i = 0; i < n; i++) cout << s[i].second << endl;
  } else
    cout << "NO" << endl;
  return 0;
}
