#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  string s[n + 10];
  pair<int, string> p[n + 10];
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    p[i].first = s[i].size();
    p[i].second = s[i];
  }
  sort(p + 1, p + n + 1);
  int kol = 0;
  for (int i = 2; i <= n; i++) {
    int k;
    k = p[i].second.find(p[i - 1].second);
    if (k < 0 || p[i].second.size() < k) {
      cout << "NO";
      ;
      return 0;
    }
  }
  cout << "YES"
       << "\n";
  for (int i = 1; i <= n; i++) cout << p[i].second << "\n";
}
