#include <bits/stdc++.h>
using namespace std;
map<pair<pair<long long int, long long int>,
         pair<long long int, long long int> >,
    long long int>
    pqr;
map<pair<long long int, long long int>, long long int> xyz;
vector<pair<int, pair<int, int> > > a;
vector<pair<pair<int, int>, pair<int, int> > > b;
vector<pair<int, int> > c;
bool compare(string &x, string &y) { return x.size() < y.size(); }
int main() {
  int n, i;
  cin >> n;
  vector<string> arr(n);
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr.begin(), arr.end(), compare);
  for (i = 0; i < n - 1; i++) {
    if (arr[i + 1].find(arr[i]) == string::npos) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES" << endl;
  for (auto it : arr) {
    cout << it << endl;
  }
  return 0;
}
