#include <bits/stdc++.h>
using namespace std;
bool cmp(string a, string b) { return (a.length() < b.length()); }
int n;
string s[110];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> s[i];
  sort(s, s + n, cmp);
  for (int i = 0; i < n - 1; i++) {
    size_t pos = s[i + 1].find(s[i]);
    if (pos == string::npos) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) cout << s[i] << '\n';
  return 0;
}
