#include <bits/stdc++.h>
using namespace std;
const int MAX = 1000 * 100 + 1;
const long long INF = 1e18;
const int MOD = 1000 * 1000 * 1000 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  string s;
  cin >> n;
  vector<pair<int, string>> v;
  for (int i = 0; i < n; i++) {
    cin >> s;
    v.push_back(make_pair((int)(s).size(), s));
  }
  sort(v.begin(), v.end());
  for (int i = 1; i < n; i++) {
    std::size_t found = v[i].second.find(v[i - 1].second);
    if (found == std::string::npos) return cout << "NO", 0;
  }
  cout << "YES\n";
  for (auto i : v) cout << i.second << "\n";
}
