#include <bits/stdc++.h>
using namespace std;
int compare(string str1, string str2) {
  if (str1.length() < str2.length()) return 1;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  string arr[100];
  for (int i = 0; i < n; i++) {
    string temp;
    cin >> temp;
    arr[i] = (temp);
  }
  sort(arr, arr + n, compare);
  bool flag = true;
  for (int i = 0; i < n - 1; i++) {
    if (arr[i + 1].find(arr[i]) == std::string::npos) {
      flag = false;
      break;
    }
  }
  if (flag) {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) cout << arr[i] << endl;
  } else
    cout << "NO" << endl;
}
