#include <bits/stdc++.h>
using namespace std;
void solve();
void files() { solve(); }
int main() {
  std::ios::sync_with_stdio(false);
  files();
}
const int maxn = 1e5 + 7;
int n;
string s[maxn];
string ss = ",,,";
bool cmp(string &s1, string &s2) { return s1.size() < s2.size(); }
void solve() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> s[i];
  int fg = 1;
  sort(s + 1, s + 1 + n, cmp);
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (s[j].find(s[i]) == -1) fg = 0;
    }
  }
  if (fg)
    cout << "YES" << endl;
  else {
    cout << "NO" << endl;
    return;
  }
  for (int i = 1; i <= n; i++) cout << s[i] << endl;
}
