#include <bits/stdc++.h>
using namespace std;
bool s(string s1, string s2) {
  if (s1.length() < s2.length()) return true;
  return false;
}
string a[105];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n, s);
  for (int i = 1; i < n; i++) {
    if (a[i].find(a[i - 1]) > a[i].length() || a[i].find(a[i - 1]) < 0) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) {
    cout << a[i] << endl;
  }
}
