#include <bits/stdc++.h>
using namespace std;
bool cmp(string a, string b) { return a.size() < b.size(); }
int main() {
  string s;
  vector<string> v;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    v.push_back(s);
  }
  sort(v.begin(), v.end(), cmp);
  for (int i = 0; i < v.size() - 1; i++) {
    if (v[i + 1].find(v[i]) == -1) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << "\n";
  }
  return 0;
}
