#include <bits/stdc++.h>
using namespace std;
const int INF = ~(1 << 31);
const double E = exp(1.0);
const double Pi = 4 * atan(1.0);
const int N = 100 + 5;
string a[N];
bool cmp(string &a1, string &a2) { return a1.length() < a2.length(); }
int main() {
  int n;
  cin >> n;
  int i, j;
  for (i = 0; i <= n - 1; ++i) {
    cin >> a[i];
  }
  sort(a, a + n, cmp);
  for (i = 0; i <= n - 2; ++i) {
    int pos = a[i + 1].find(a[i], 0);
    if (pos == -1) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  for (i = 0; i <= n - 1; ++i) cout << a[i] << endl;
  return 0;
}
