#include <bits/stdc++.h>
using namespace std;
struct Node {
  string s;
  int l;
} ss[300];
bool cmp(const Node &a, const Node &b) { return (a.l < b.l); }
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    cin >> ss[i].s;
    ss[i].l = ss[i].s.size();
  }
  sort(ss + 1, ss + n + 1, cmp);
  int k = 0;
  for (int i = 2; i <= n; i++) {
    string::size_type idx = ss[i].s.find(ss[i - 1].s);
    if (idx == string::npos) {
      k = 1;
      break;
    }
  }
  if (k == 1)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    for (int i = 1; i <= n; i++) {
      cout << ss[i].s << endl;
    }
  }
}
