#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T &x) {
  char c;
  int flag = 1;
  while ((c = getchar()) < '0' || c > '9')
    if (c == '-') flag *= -1;
  x = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') x = x * 10 + c - '0';
  x *= flag;
  return;
}
bool cmp(string a, string b) {
  if (a.length() == b.length())
    return a < b;
  else
    return a.length() < b.length();
}
vector<string> v;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string a;
    cin >> a;
    v.push_back(a);
  }
  sort(v.begin(), v.end(), cmp);
  bool ok = 1;
  for (int i = 0; i < n - 1; ++i) {
    if (v[i].length() == v[i + 1].length() && v[i] != v[i + 1]) ok = false;
    int pos = v[i + 1].find(v[i]);
    if (pos == string::npos) ok = false;
  }
  if (ok) {
    cout << "YES\n";
    for (int i = 0; i < n; ++i) cout << v[i] << endl;
  } else
    cout << "NO\n";
}
