#include <bits/stdc++.h>
using namespace std;
int n;
string f;
vector<pair<int, string>> s(1000);
int main() {
  cin >> n;
  for (int i = 0; i < n; i++)
    cin >> s[i].second, s[i].first = (s[i].second).size();
  sort(s.begin(), s.end() - 1000 + n);
  for (int i = 0; i < n; i++) {
    f = s[i].second;
    for (int j = i + 1; j < n; j++)
      if ((s[j].second).find(f) == -1) {
        cout << "NO";
        return 0;
      }
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) cout << s[i].second << "\n";
}
