#include <bits/stdc++.h>
using namespace std;
bool cmp(string l, string r) {
  if (l.length() != r.length()) return l.length() < r.length();
  return l < r;
}
int main() {
  int n;
  cin >> n;
  string a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n, cmp);
  int ans = 1;
  for (int i = 1; i < n; i++) {
    if (a[i].find(a[i - 1]) != string::npos)
      ;
    else {
      ans = 0;
      break;
    }
  }
  if (ans) {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) cout << a[i] << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
