#include <bits/stdc++.h>
using namespace std;
int way(string s1, string s2) { return s1.size() < s2.size(); }
int isSubstring(string s1, string s2) {
  int M = s1.length();
  int N = s2.length();
  for (int i = 0; i <= N - M; i++) {
    int j;
    for (j = 0; j < M; j++)
      if (s2[i + j] != s1[j]) break;
    if (j == M) return i;
  }
  return -1;
}
int main() {
  int i, j, k, l, m, n, cnt = 0;
  cin >> n;
  vector<string> vec;
  string s;
  for (i = 1; i <= n; i++) {
    cin >> s;
    vec.push_back(s);
  }
  sort(vec.begin(), vec.end(), way);
  for (i = 0; i < n - 1; i++) {
    k = isSubstring(vec[i], vec[i + 1]);
    if (k != -1) cnt++;
  }
  if (cnt == n - 1) {
    cout << "YES" << endl;
    for (i = 0; i < n; i++) cout << vec[i] << endl;
  } else
    cout << "NO" << endl;
  return 0;
}
