#include <bits/stdc++.h>
using namespace std;
bool comp(string& a, string& b) { return a.size() <= b.size(); }
int main() {
  int n;
  string words[100];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> words[i];
  }
  sort(words, words + n, comp);
  bool success = true;
  for (int i = 0; i < n - 1; i++) {
    if (words[i + 1].find(words[i]) == -1) {
      success = false;
      break;
    }
  }
  if (success) {
    printf("YES\n");
    for (int i = 0; i < n; i++) cout << words[i] << endl;
  } else
    printf("NO\n");
  return 0;
}
