#include <bits/stdc++.h>
using namespace std;
struct compare {
  bool operator()(const std::string& first, const std::string& second) {
    return first.size() < second.size();
  }
};
int main(int argc, char* argv[]) {
  int n, k;
  vector<string> str;
  string dummy, str1, str2;
  compare c;
  cin >> n;
  getline(cin, dummy);
  for (int i = 0; i < n; i++) {
    getline(cin, dummy);
    str.push_back(dummy);
  }
  sort(str.begin(), str.end(), c);
  if (n == 1) {
    cout << "YES" << endl;
    cout << str[0];
    return 0;
  } else {
    for (k = 1; k < n; k++) {
      str2 = str[k];
      str1 = str[k - 1];
      size_t found = str2.find(str1);
      if (found != std::string::npos)
        continue;
      else
        break;
    }
    if (k == n) {
      cout << "YES" << endl;
      for (int i = 0; i < n; i++) cout << str[i] << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
