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