#include <bits/stdc++.h>
using namespace std;
const int mod = (int)1e9 + 7;
pair<long long int, long long int> s4[4] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
pair<long long int, long long int> s8[8] = {
    {-1, -1}, {-1, 0}, {-1, 1}, {0, -1}, {0, 1}, {1, 1}, {1, 0}, {1, -1}};
void judge() {}
bool compare(string s1, string s2) {
  if (s1.size() == s2.size()) {
    return s1 < s2;
  }
  return s1.size() < s2.size();
}
void solve() {
  int n;
  cin >> n;
  string s[n];
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  sort(s, s + n, compare);
  bool flag = true;
  for (int i = 0; i < n - 1; i++) {
    if (s[i + 1].find(s[i]) == string::npos) {
      flag = false;
      break;
    }
  }
  if (flag) {
    cout << "YES" << '\n';
    for (int i = 0; i < n; i++) {
      cout << s[i] << '\n';
    }
  } else {
    cout << "NO" << '\n';
  }
}
signed main() {
  judge();
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  solve();
}
