#include <bits/stdc++.h>
using namespace std;
long long i, j, k, l, n, m, flag;
string a[109];
bool cmp(string a, string b) {
  if (a.length() < b.length())
    return true;
  else
    return false;
}
bool check(string a, string b) {
  if (a.length() == b.length()) {
    if (a == b)
      return true;
    else
      return false;
  }
  if (b.find(a) == -1) return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + 1 + n, cmp);
  for (i = 1; i < n; i++) {
    if (!check(a[i], a[i + 1])) {
      cout << "NO" << endl;
      exit(0);
    }
  }
  cout << "YES" << endl;
  for (i = 1; i <= n; i++) cout << a[i] << endl;
  exit(0);
}
