#include <bits/stdc++.h>
using namespace std;
bool cmp(string a, string b) { return a.length() < b.length(); }
int main() {
  int n;
  while (~scanf("%d", &n)) {
    vector<string> t;
    vector<string> tt;
    string s;
    int vis[110] = {0};
    for (int i = 0; i < n; i++) {
      cin >> s;
      t.push_back(s);
      if (vis[s.length()] == 0) {
        vis[s.length()] = 1;
        tt.push_back(s);
      }
    }
    sort(t.begin(), t.end(), cmp);
    int flag = 0;
    for (int i = 0; i < t.size() - 1; i++) {
      if (t[i].length() == t[i + 1].length())
        if (t[i] != t[i + 1]) {
          flag = 1;
          break;
        }
    }
    if (flag == 1)
      printf("NO\n");
    else {
      int flag = 0;
      sort(tt.begin(), tt.end(), cmp);
      for (int i = 0; i < tt.size() - 1; i++) {
        if (tt[i + 1].find(tt[i]) == -1) {
          flag = 1;
          break;
        }
      }
      if (flag == 0) {
        printf("YES\n");
        for (int i = 0; i < t.size(); i++) {
          cout << t[i] << endl;
        }
      } else
        printf("NO\n");
    }
  }
}
