#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long inf = 1000000000009;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n{};
  vector<pair<int, string>> v;
  cin >> n;
  int mn = 1e+5;
  int pos{-1};
  for (int i = 0, sz = (int)n; i < sz; i++) {
    string s;
    cin >> s;
    v.push_back({s.size(), s});
  }
  sort((v).begin(), (v).end());
  int f{};
  for (int i = 0, sz = (int)n - 1; i < sz; i++) {
    if (v[i + 1].second.find(v[i].second) == -1) {
      f = 1;
      break;
    }
  }
  if (f)
    cout << "NO"
         << "\n";
  else {
    cout << "YES"
         << "\n";
    for (int i = 0, sz = (int)n; i < sz; i++) cout << v[i].second << "\n";
  }
  return 0;
}
