You are given a string q. A sequence of k strings s_1, s_2, ..., s_{k} is called beautiful, if the concatenation of these strings is string q (formally, s_1 + s_2 + ... + s_{k} = q) and the first characters of these strings are distinct.

Find any beautiful sequence of strings or determine that the beautiful sequence doesn't exist.


-----Input-----

The first line contains a positive integer k (1 ≤ k ≤ 26) — the number of strings that should be in a beautiful sequence. 

The second line contains string q, consisting of lowercase Latin letters. The length of the string is within range from 1 to 100, inclusive.


-----Output-----

If such sequence doesn't exist, then print in a single line "NO" (without the quotes). Otherwise, print in the first line "YES" (without the quotes) and in the next k lines print the beautiful sequence of strings s_1, s_2, ..., s_{k}.

If there are multiple possible answers, print any of them.


-----Examples-----
Input
1
abca

Output
YES
abca

Input
2
aaacas

Output
YES
aaa
cas

Input
4
abc

Output
NO



-----Note-----

In the second sample there are two possible answers: {"aaaca", "s"} and {"aaa", "cas"}.

Difficulty: interview

Starter code:

Solutions:
import sys

#fin = open("input.txt", 'r')
fin = sys.stdin

n = int(fin.readline())
s = fin.readline().strip()
i = 1
cur = 0
used = {c: False for c in "qwertyuiopasdfghjklzxcvbnm"}
starts = [0]
used[s[0]] = True
while i < len(s) and cur < n - 1:
    if not used[s[i]]:
        used[s[i]] = True
        starts.append(i)
        cur += 1
    i += 1
if cur < n - 1:
    print("NO")
else:
    print("YES")
    starts.append(len(s))
    for i in range(len(starts) - 1):
        print(s[starts[i]:starts[i + 1]])


N = int(input())
q = input()
if len(set(q)) >= N:
    print('YES')
    chars = list(set(q))
    start = False
    for index,c in enumerate(q):
        if c in chars:
            if start is not False:
                print(q[start:index])
            N -= 1
            chars.remove(c)
            if N == 0:
                chars = []
            start = index
    else:
        print(q[start:])
    
else:
    print('NO')



n = int(input())
letters = set([])
pos = []
s = input()
counter = 0
for c in s:
    if not c in letters:
        letters.add(c)
        pos.append(counter)
        if len(letters)==n:
            break
    counter+=1
if len(letters) != n:
    print("NO")
    return
else:
    print("YES")
    pos.append(len(s))
    for i in range(len(pos)-1):
        print(s[pos[i]:pos[i+1]])

import time
import string
class Profiler(object):
    def __enter__(self):
        self._startTime = time.time()

    def __exit__(self, type, value, traceback):
        print("Elapsed time: {:.3f} sec".format(time.time() - self._startTime))


k = int(input())
s = input()
#b = list(map(int, input().split()))

m = {}
for el in string.ascii_lowercase:
    m[el] = 0
if len(set(s)) < k:
    print('NO')
else:
    i = 0
    t = []
    while i < len(s):
        if k == 1:
            t.append(s[i:])
            break
        if m[s[i]] == 0:
            m[s[i]] = 1
            tmp = s[i]
            i += 1
            while i < len(s) and m[s[i]]:
                tmp += s[i]
                i += 1
            t.append(tmp)
            k -= 1
        else:
            i += 1
    print('YES')
    for el in t:
        print(el)

'''
fin = open("input.txt")
fout = open("output.txt", "w")

n = int(fin.readline())
cases = list()

for i in range(n):
    fin.readline()
    cases.append(list(fin.readline().split()))

for i in range(1, len(cases)+1):
    cur_min = 1001
    added_min = 0
    lst = list(map(int, cases[i-1]))
    while max(lst) > 1:
        mmax = max(lst)
        if cur_min > mmax + added_min:
            cur_min = mmax + added_min
        count_max = lst.count(mmax)
        tmp_lst = list()
        for sym in lst:
            if sym is not mmax:
                tmp_lst.append(sym)
            else:
                if sym % 2 is 0:
                    tmp_lst.append(sym//2)
                    tmp_lst.append(sym//2)
                else:
                    tmp_lst.append(sym//2)
                    tmp_lst.append(sym//2 + 1)
        added_min += count_max
        lst = tmp_lst.copy()



    fout.write("Case #" + i.__str__() + ": " + cur_min.__str__() + "\n")
fin.close()
fout.close()
'''

n = int(input())
s = input()
t = []
k = []
for i in range(len(s)):
    if s[i] not in t:
        t.append(s[i])
        k.append(i)
if len(t)<n:
    print("NO")
else:
    print("YES")
    for u in range(n-1):
        print(s[k[0]:k[1]])
        k.pop(0)
    print(s[k[0]:])
        



k = int(input())
q = input()

i = 0
met = []
ts = []
while i < len(q):
    if q[i] in met:
        i += 1
    else:
        met.append(q[i])
        ts.append(i)
ts.append(len(q))

if len(ts) >= k + 1:
    print('YES')
    for i in range(len(ts) - 1):
        a = ts[i]
        b = ts[i + 1]
        if i == k - 1:
            print(q[a:])
            break
        print(q[a:b])
else:
    print('NO')



#!/usr/bin/env python3
# -*- coding: utf-8 -*-

k = int(input())
str = input()

dic = {}
for i in str:
    if i not in dic:
        dic[i]  = 1
    else:
        dic[i] += 1

if ( k > len(dic)):
    print("NO")
else:
    print("YES", end='')
    dic2 = []
    n = 0

    for i in str:
        if (i not in dic2) and n < k:
            print()
            print(i, end='')
            n += 1
            dic2.append(i)
        else:
            print(i, end='')

    print()



r = lambda : list(map(int,input().split()))

import sys
n = int(input())
s = input()
q = set()
if n>len(set(s)) :
    print('NO')
else :
    print('YES')
    k = 0
    ans = []
    for i in range(len(s)) :
        if k==n : break
        if s[i] not in q :
            ans.append(i)
            q.add(s[i])
            k+=1
    ans.append(len(s))
    for i in range(len(ans)-1) :
        print(s[ans[i]:ans[i+1]])
                


n = int(input())
s = input()
q = set()
if n>len(set(s)) :
    print('NO')
else :
    print('YES')
    k = 0
    ans = []
    for i in range(len(s)) :
        if k==n : break
        if s[i] not in q :
            ans.append(i)
            q.add(s[i])
            k+=1
    ans.append(len(s))
    for i in range(len(ans)-1) :
        print(s[ans[i]:ans[i+1]])



k = int(input())
q = input()

def program(k, q):
    if k > len(set(q)):
        print("NO")
        return
    used = []
    ss = []
    while len(q) > 0:
        ch = q[0]
        q = q[1:]
        if (ch in used) or k - len(ss) == 0:
            ss[-1] += ch
        else:
            ss.append(ch)
        used.append(ch)
    print("YES")
    for s in ss:
        print(s)
    
program(k, q)
    


from collections import Counter


number_of_words = int(input())
input_string = input()
words_dict = Counter(input_string)
if len(words_dict) < number_of_words:
    print('NO')
else:
    print('YES')
    if number_of_words == 1:
        print(input_string)
    else:
        using_letters = []
        for i in range(0, number_of_words - 1):
            output_string = ''
            current_letter = input_string[0]
            using_letters += current_letter
            while True:
                if input_string[0] in using_letters:
                    output_string += input_string[0]
                    input_string = input_string[1:]
                else:
                    break
            print(output_string)
        print(input_string)

import sys


n = int(input())
s = str(input())
l = []

for i in s:
    if not i in l:
        l.append(i)

vals = []

if len(l) < n:
    print("NO")
    return
else:
    print("YES")
    for i in range(n):
        vals.append(s.index(l[i]))

for i in range(n):
    if i == n-1:
        print(s[vals[len(vals)-1]:len(s)])
    else:
        print(s[vals[i]:vals[i+1]])


def main():
    n = int(input())
    s = input()
    result = []
    substring = []
    d = set()

    for i in range(len(s)):
        if n > 0 and s[i] not in d:
            if len(substring) > 0 :
                result.append(''.join(substring))
                substring = []
            substring.append((s[i]))
            d.add(s[i])
            n -= 1
        else:
            substring.append((s[i]))

    if len(substring) > 0 :
        result.append(''.join(substring))
    if n > 0:
        print('NO')
        return
    else:
        print('YES')
        for s in result:
            print(s)






def __starting_point():
    main()
__starting_point()

n = int(input())
a = input()
d = {}
count = 0
for i in range(len(a)):
    if d.get(a[i]) == None:
        d[a[i]] = 1
        count += 1
if count >= n:
    print('YES')
    d = {}
    count = 0
    i = 0
    j = 0
    while count < n - 1:
        if d.get(a[i]) == None:
            d[a[i]] = 1
            if a[j:i] != '':
                count += 1 
                print(a[j:i])
                j = i
        i += 1
    print(a[j:])            
else:
    print('NO')

n = int(input())
s = input()
s1 = set()
ar = []
i = 0
prs = ''
j = 0
while len(ar) < n and i < len(s):
    ar.append(s[i])
    s1.add(s[i])
    i += 1
    while i < len(s) and s[i] in s1:
        ar[-1] += s[i]
        i += 1
    
    
if i < len(s):
    ar[-1] += s[i:]
if len(ar) < n:
    print('NO')
else:
    print('YES')
    for i in ar:
        print(i)

n = int(input())
s = input()
if n == 1:
    print("YES")
    print(s)
    return
a = []
b = []
for i in range(26):
    a.append(0)
    b.append(-1)
for i in range(len(s)):
    a[ord(s[i])-ord('a')] += 1
    if b[ord(s[i])-ord('a')] == -1:
        b[ord(s[i])-ord('a')] = i
    #print(s[i], i)
num = 0
c = []
for i in range(26):
    if a[i] != 0:
        num += 1
        c.append(b[i])
#print(c)
i = 0
lastNum = 0
if num < n:
    print("NO")
else:
    print("YES")
    minNum = 100000
    for i in range(len(c)):
        if minNum > c[i]:
            minNum = c[i]
            minNumPos = i
    if c[minNumPos] != 0:
        print(s[:c[minNumPos]])
        lastNum = c[minNumPos]
        n -= 1
    c[minNumPos] = 100000
    while n > 1:
        minNum = 100000
        for i in range(len(c)):
            if minNum > c[i]:
                minNum = c[i]
                minNumPos = i
        print(s[lastNum:c[minNumPos]])
        lastNum = c[minNumPos]
        c[minNumPos] = 100000
        #print(c, lastNum)
        n -= 1
    print(s[lastNum:])
    #print(c, lastNum)
#if num >= n:


#print(a, b)


k = int(input())
q = input()
ans_strings = []
starts = []
for i in range(len(q)):
    if q[i] not in starts:
        if k > 1:
            starts.append(q[i])
            ans_strings.append(q[i])
            k -= 1
        elif k == 1:
            ans_strings.append(q[i::])
            k -= 1
            break
    else:
        ans_strings[len(ans_strings) - 1] += q[i]
if k == 0:
    print("YES")
    for i in ans_strings:
        print(i)
else:
    print("NO")

def output():
	print("YES")
	
	for st in ans:
		print(st)

k = int(input())
q = input()
n = len(q)

ans = []
used = set()
lim = 1
last = -1
for i in range(n):
	if q[i] not in used:
		if last != -1:
			lim += 1
			ans.append(q[last : i])
		used.add(q[i])
		last = i
	if lim == k:
		ans.append(q[i:])
		output()
		break
			
if lim < k:
	print("NO")

from collections import OrderedDict
count = int(input())
line  = input()

uniq = "".join(OrderedDict.fromkeys(line).keys())

if count > len(uniq):
	print("NO")
else:
	print("YES")
	if count == len(uniq):
		while len(line) != 0:
			first_uniq = 0
			uniq = uniq[1:]
			if len(uniq) == 0:
				print(line)
				break
			last_uniq = line.find(uniq[0])
			print(line[first_uniq:last_uniq])
			line = line[last_uniq:]
	else:
		while count != 1:
			first_uniq = 0
			uniq = uniq[1:]
			last_uniq = line.find(uniq[0])
			print(line[first_uniq:last_uniq])
			line = line[last_uniq:]
			count -= 1
		print(line)

def TrueCount(a):
	c = 0
	for i in a:
		if(i == True):
			c += 1
	return c

def uniqueStrings(a,s):
	b = []
	c = []
	x = 0
	c.append(s[0])
	for i in range(len(s)):
		if s[i] not in c:
			b.append(s[x:i])
			c.append(s[i])
			x = i
	b.append(s[x:len(s)])
	return b

n = int(input())
s = input()

a = [False]*26

for i in s:
	a[ord(i) - ord('a')] = True

k = TrueCount(a)

if(k < n):
	print("NO")
else:
	print("YES")
	b = uniqueStrings(a,s)
	i = 0
	while(i < n-1):
		print(b[i])
		i += 1
	print(''.join(b[i:len(b)]))

k, q, v, s = int(input()), input(), 'YES', set()
for ch in q:
    if k == 0 or ch in s:
        v += ch
    else:
        v += '\n' + ch
        s.add(ch)
        k -= 1
print('NO' if k else v)

k = int(input())
string = input()
first_char_set = set()
length = len(string)
unique_mnt = 0
res_ind = []
if k > length:
    print("NO")
    return
if k == 1:
    print("YES")
    print(string)
    return
for i in range(length):
    c = string[i]
    if not(c in first_char_set):
        unique_mnt += 1
        first_char_set.add(c)
        res_ind.append(i)
if k > len(res_ind):
    print("NO")
    return
res = []
res_len = len(res_ind)
for i in range(res_len - 1):
    cur_ind = res_ind[i]
    next_ind = res_ind[i+1]
    if k > 1:
        res.append(string[cur_ind:next_ind])
        k -= 1
    elif k == 1:
        res.append(string[cur_ind:])
        k -= 1
        break
if k == 1:
    res.append(string[next_ind:])
print("YES")
for el in res:
    print(el)


k = int(input())
q = input()
cut = [0]
topset = set([q[0]])
for i in range(1, len(q)):
    if len(cut) == k:
        break
    if q[i] not in topset:
        cut.append(i)
        topset.add(q[i])
        
if len(cut) < k:
    print('NO')
else:
    print('YES')
    for i in range(k-1):
        print(q[cut[i]:cut[i+1]])
    print(q[cut[-1]:])


def solve():
    n = int(input())
    s = str(input())

    if n == 1:
        print("YES")
        print(s)
        return

    mp = dict()
    pos = []
    for i, letter in enumerate(s):
        if letter in mp:
            continue
        else:
            mp[letter] = True
            pos.append(i)

    if len(mp) < n:
        print("NO")
    else:
        print("YES")
        start = 0
        for i in range(n - 1):
            print(s[start: pos[i + 1]])
            start = pos[i + 1]
        print(s[start:])

def __starting_point():
    solve()





__starting_point()

n = int(input())
s = k = input()
if len(s) < n or len(s) == n and len(set(s)) < n or len(set(s))<n :
    print('NO')
elif len(s) == n:
    print ('YES')
    for i in range(n):
        print(s[i])
        
        
else:
    print('YES')
    r = ''
    for element in s:
        if element not in r:
            r+=element
    
    j = 0
    for i in range(n-1):
        print(s[j:s.find(r[i+1])])
        j = s.find(r[i+1])        
        
        
    print(s[j:])