#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> v(n);
  for (auto& i : v) {
    cin >> i;
  }
  sort(v.begin(), v.end(),
       [](const std::string& first, const std::string& second) {
         return first.size() < second.size();
       });
  for (int i = n - 1; i >= 0; --i) {
    for (int j = i - 1; j >= 0; --j) {
      if (v[i].find(v[j]) == std::string::npos) {
        cout << "NO";
        goto label;
      }
    }
  }
  cout << "YES\n";
  for (auto i : v) {
    cout << i << "\n";
  }
label:
  return 0;
}
