#include <bits/stdc++.h>
using namespace std;
int k, size, r;
string temp;
bool flag[28];
bool check[28];
int main() {
  cin >> k >> temp;
  size = temp.size();
  for (int i = 0; i < size; i++) {
    if (flag[temp[i] - 'a'])
      continue;
    else {
      flag[temp[i] - 'a'] = true;
      r++;
    }
  }
  if (k > r)
    cout << "NO" << endl;
  else {
    cout << "YES";
    int cur = 0;
    for (int i = 0; i < k; i++) {
      cout << endl;
      if (!check[temp[cur] - 'a']) {
        check[temp[cur] - 'a'] = true;
        while ((check[temp[cur] - 'a']) && cur < size) cout << temp[cur++];
      }
    }
    while (cur < size) cout << temp[cur++];
    cout << endl;
  }
  return 0;
}
