#include <bits/stdc++.h>
using namespace std;
constexpr long long int INF = 4294967297;
constexpr double pi = 3.14159265358979;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  multiset<pair<int, string>> my;
  for (int i = 0; i < n; ++i) {
    string x;
    cin >> x;
    my.insert(make_pair(x.size(), x));
  }
  for (auto i = next(my.begin()); i != my.end(); ++i) {
    auto it = (*i).second.find((*prev(i)).second);
    if (it == string::npos) return cout << "NO", 0;
  }
  cout << "YES\n";
  for (auto i = my.begin(); i != my.end(); ++i) cout << (*i).second << endl;
  return 0;
}
