#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s[n];
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  vector<pair<int, int>> vec;
  for (int i = 0; i < n; i++) {
    vec.push_back(make_pair(s[i].length(), i));
  }
  sort(vec.begin(), vec.end());
  for (int i = 0; i < n; i++) {
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      std::size_t found = s[vec[j].second].find(s[vec[i].second]);
      if (found == std::string::npos) {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    cout << s[vec[i].second] << endl;
  }
  return 0;
}
