#include <bits/stdc++.h>
using namespace std;
long long ans;
bool b, ext;
void O_o() {
  ios::sync_with_stdio(0);
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
}
int main() {
  O_o();
  set<int> st;
  int n;
  cin >> n;
  vector<string> second, arr(n);
  for (int i = 0; i < int(n); i++)
    cin >> arr[i], st.insert(((int)(arr[i].size())));
  for (auto i : st) {
    for (int j = 0; j < int(n); j++)
      if (((int)(arr[j].size())) == i) second.push_back(arr[j]);
  }
  for (int i = (((int)(second.size()))); --i >= 0;) {
    ext = 0;
    b = 0;
    if (i - 1 >= 0) {
      for (int k = 0; k < int(((int)(second[i].size()))); k++) {
        b = 0;
        int x = 0;
        for (int j = k; j < k + ((int)(second[i - 1].size())); j++) {
          if (second[i][j] != second[i - 1][x]) b = 1;
          x++;
        }
        if (!b) ext = 1;
      }
      if (!ext) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < int(((int)(second.size()))); i++)
    cout << second[i] << endl;
  return 0;
}
