#include <bits/stdc++.h>
using namespace std;
bool cmp(string &s1, string &s2) { return s1.size() < s2.size(); }
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<string> s(n);
  for (int i = 0; i < n; ++i) cin >> s[i];
  sort(s.begin(), s.end(), cmp);
  bool flag = true;
  for (int i = 1; i < s.size(); ++i) {
    if (s[i].find(s[i - 1]) == -1) {
      flag = false;
      break;
    }
  }
  if (flag) {
    cout << "YES\n";
    for (int i = 0; i < s.size(); ++i) cout << s[i] << endl;
  } else {
    cout << "NO";
  }
  return 0;
}
