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