#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
void solve() {
  long long n;
  cin >> n;
  vector<string> s(n);
  for (long long i = 0; i < n; i++) {
    cin >> s[i];
  }
  sort(s.begin(), s.end(),
       [&](const string& s, const string& t) { return s.size() < t.size(); });
  for (long long i = 0; i < n - 1; i++) {
    if (s[i + 1].find(s[i]) == string::npos) {
      cout << "NO" << endl;
      return;
    }
  }
  cout << "YES" << endl;
  for (auto it : s) cout << it << endl;
}
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  srand(chrono::high_resolution_clock::now().time_since_epoch().count());
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
