#include <bits/stdc++.h>
using namespace std;
vector<pair<int, string> > a;
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    a.push_back({s.size(), s});
  }
  sort(a.begin(), a.end());
  for (int i = a.size() - 1; i >= 1; i--) {
    string s = a[i].second;
    for (int j = i - 1; j >= 0; j--) {
      string t = a[j].second;
      int len = a[j].first;
      bool ok = 0;
      for (int i = 0; i + len - 1 < s.size(); i++) {
        if (s.substr(i, len) == t) {
          ok = 1;
          break;
        }
      }
      if (ok == 0) {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES\n";
  for (int i = 0; i < a.size(); i++) {
    cout << a[i].second << "\n";
  }
  return 0;
}
