#include <bits/stdc++.h>
using namespace std;
bool compare(string &s1, string &s2) { return s1.size() < s2.size(); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  vector<string> s;
  string str;
  int n, i, j, flag = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> str;
    s.push_back(str);
  }
  sort(s.begin(), s.end(), compare);
  for (i = 0; i < n - 1; i++) {
    j = 0;
    while (j < s[i + 1].length()) {
      int l = s[i].length();
      flag = 0;
      if (s[i] == s[i + 1].substr(j, l)) {
        flag = 1;
        break;
      }
      j++;
    }
    if (flag != 1) {
      cout << "NO\n";
      break;
    }
  }
  if (flag == 1 || n == 1) {
    cout << "YES\n";
    for (i = 0; i < n; i++) {
      cout << s[i] << "\n";
    }
  }
}
