#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string q;
  cin >> n >> q;
  if (n > q.size())
    cout << "NO" << endl;
  else {
    int x[150] = {};
    int X[150] = {};
    int y = 0;
    for (int i = 0; i < q.size(); i++) {
      int h = q[i] - 'a';
      if (!x[h] && y != n) {
        x[h] = i + 1;
        y++;
      }
      X[i] = y;
    }
    if (y == n) {
      cout << "YES" << endl;
      for (int i = 0; i < q.size(); i++) {
        if (i > 0 && X[i] != X[i - 1]) cout << endl;
        cout << q[i];
      }
      cout << endl;
    } else
      cout << "NO" << endl;
  }
  return 0;
}
