#include <bits/stdc++.h>
using namespace std;
bool yod(int k, string s) {
  int sol = 0;
  char chin;
  for (int i = 97; i <= 122; i++) {
    chin = i;
    bool yo = 0;
    for (int j = 0; j < s.size(); j++) {
      if (s[j] == chin) yo = 1;
    }
    sol += yo;
  }
  if (sol >= k)
    return 1;
  else
    return 0;
}
int wit(char a, string s) {
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == a) return i;
  }
  return -1;
}
int main() {
  int k, mdv;
  string s;
  char chir;
  cin >> k >> s;
  if (yod(k, s) == 0) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  vector<bool> apu;
  apu.resize(s.size());
  for (int i = 97; i <= 122; i++) {
    chir = i;
    mdv = wit(chir, s);
    if (mdv != -1) apu[mdv] = 1;
  }
  int cnt = k == 1;
  for (int i = 0; i < s.size(); i++) {
    if (cnt == k) {
      for (int j = i; j < s.size(); j++) cout << s[j];
      cout << endl;
      return 0;
    } else {
      if (apu[i]) {
        if (cnt != 0) cout << endl;
        cnt++;
      }
      cout << s[i];
    }
  }
  cout << endl;
  return 0;
}
