#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e6 + 20, mod = 1e9 + 7, inf = 1e9;
long long n, m, x1, d, z, t, pos, ans, sum, x, y, mixi, mini, a[MAXN], b[MAXN];
pair<long long, long long> pr[MAXN];
string s[MAXN];
vector<string> ss[MAXN];
bool check(string s1, string s2) {
  string s3 = "";
  for (int i = 0; i < s1.size(); i++) {
    s3 += s2[i];
  }
  for (int i = s1.size(); i < s2.size(); i++) {
    if (s3 == s1) {
      return true;
    }
    s3.erase(0, 1);
    s3 += s2[i];
  }
  if (s3 == s1) {
    return true;
  }
  return false;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    ss[s[i].size()].push_back(s[i]);
  }
  for (int i = 1; i <= 100; i++) {
    if (ss[i].size()) {
      string h = ss[i][0];
      for (int j = 1; j < ss[i].size(); j++) {
        if (h != ss[i][j]) {
          return cout << "NO", 0;
        }
      }
    }
  }
  string h = "";
  for (int i = 1; i <= 100; i++) {
    if (ss[i].size()) {
      if (h == "") {
        h = ss[i][0];
      } else {
        if (!check(h, ss[i][0])) {
          return cout << "NO", 0;
        }
        h = ss[i][0];
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= 100; i++) {
    for (int j = 0; j < ss[i].size(); j++) {
      cout << ss[i][j] << endl;
    }
  }
}
