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