#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 3;
const int MOD = 1e9 + 7LL;
const int OO = 0x3f3f3f;
struct exam {
  int st, deadline, c, idx;
  bool operator<(const exam &other) const { return deadline > other.deadline; }
};
int main() {
  int n;
  cin >> n;
  vector<string> arr(n);
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr.begin(), arr.end(),
       [](string &a, string &b) { return a.size() < b.size(); });
  bool ok = true;
  for (int i = 1; i < n; i++) {
    if (arr[i].find(arr[i - 1]) == string::npos) {
      ok = false;
    }
  }
  if (!ok) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
    for (int i = 0; i < n; i++) cout << arr[i] << endl;
  }
}
