#include <bits/stdc++.h>
using namespace std;
bool h[26];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int k, t = 0;
  string s;
  cin >> k >> s;
  for (int i = 0; i < s.size(); i++) {
    if (!h[s[i] - 'a']) t++;
    h[s[i] - 'a'] = true;
  }
  if (k > t)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    fill(h, h + 26, false);
    int i = 0, t = 0;
    while (i < s.size() && t < k - 1) {
      if (h[s[i] - 'a'])
        cout << s[i];
      else {
        if (t != 0) cout << endl;
        cout << s[i];
        t++;
        h[s[i] - 'a'] = true;
      }
      i++;
    }
    while (h[s[i] - 'a']) {
      cout << s[i];
      i++;
    }
    if (k != 1) cout << endl;
    for (int j = i; j < s.size(); j++) cout << s[j];
    cout << endl;
  }
  return 0;
}
