#include <bits/stdc++.h>
using namespace std;
vector<pair<int, string>> v;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    int l = s.size();
    v.push_back({l, s});
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size() - 1; ++i) {
    string s = v[i].second, s2 = v[i + 1].second;
    long long ok = s2.find(s);
    if (ok > s2.size() || ok < 0) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < v.size(); ++i) cout << v[i].second << "\n";
  return 0;
}
