#include <bits/stdc++.h>
using namespace std;
bool myFunc(pair<int, string> a, pair<int, string> b) {
  return a.first <= b.first;
}
int main() {
  int n;
  pair<int, string> a[10005];
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    a[i].first = s.size();
    a[i].second = s;
  }
  sort(a, a + n);
  for (int i = 0; i < n - 1; i++)
    if (a[i + 1].second.find(a[i].second) == string ::npos) {
      cout << "NO";
      return 0;
    }
  cout << "YES" << endl;
  ;
  for (int i = 0; i < n; i++) cout << a[i].second << endl;
  return 0;
}
