#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s, temp;
  bool allow;
  cin >> n >> s;
  for (int i = 0; i < s.length(); ++i) {
    allow = true;
    for (int j = 0; j < temp.length(); j++) {
      if (temp[j] == s[i]) allow = false;
    }
    if (allow) temp += s[i];
  }
  if (temp.length() < n)
    cout << "NO\n";
  else {
    cout << "YES\n";
    int index = 0;
    for (int j = 0; j < n - 1; j++) {
      int i = index;
      string temp2;
      while (s[i] != temp[j + 1]) {
        temp2 += s[i];
        i++;
      }
      index = i;
      cout << temp2 << endl;
    }
    for (int i = index; i < s.length(); ++i) {
      cout << s[i];
    }
    cout << endl;
  }
}
