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