#include <bits/stdc++.h>
using namespace std;
#pragma GCC diagnostic ignored "-Wmissing-declarations"
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<string> a(n);
  for (auto& s : a) cin >> s;
  sort(begin(a), end(a),
       [](const string a, const string b) { return a.size() < b.size(); });
  bool good = true;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < i; ++j) good &= a[i].find(a[j]) != string::npos;
  if (good) {
    cout << "YES\n";
    for (const string s : a) cout << s << '\n';
  } else {
    cout << "NO\n";
  }
}
