Problem: There is the following puzzle popular among nuclear physicists.

A reactor contains a set of n atoms of some chemical elements. We shall understand the phrase "atomic number" as the number of this atom's element in the periodic table of the chemical elements.

You are allowed to take any two different atoms and fuse a new one from them. That results in a new atom, whose number is equal to the sum of the numbers of original atoms. The fusion operation can be performed several times.

The aim is getting a new pregiven set of k atoms.

The puzzle's difficulty is that it is only allowed to fuse two atoms into one, it is not allowed to split an atom into several atoms. You are suggested to try to solve the puzzle.

Input

The first line contains two integers n and k (1 ≤ k ≤ n ≤ 17). The second line contains space-separated symbols of elements of n atoms, which are available from the start. The third line contains space-separated symbols of elements of k atoms which need to be the result of the fusion. The symbols of the elements coincide with the symbols from the periodic table of the chemical elements. The atomic numbers do not exceed 100 (elements possessing larger numbers are highly unstable). Some atoms can have identical numbers (that is, there can be several atoms of the same element). The sum of numbers of initial atoms is equal to the sum of numbers of the atoms that need to be synthesized.

Output

If it is impossible to synthesize the required atoms, print "NO" without the quotes. Otherwise, print on the first line «YES», and on the next k lines print the way of synthesizing each of k atoms as equations. Each equation has the following form: "x1+x2+...+xt->yi", where xj is the symbol of the element of some atom from the original set, and yi is the symbol of the element of some atom from the resulting set. Each atom from the input data should occur in the output data exactly one time. The order of summands in the equations, as well as the output order does not matter. If there are several solutions, print any of them. For a better understanding of the output format, see the samples.

Examples

Input

10 3
Mn Co Li Mg C P F Zn Sc K
Sn Pt Y


Output

YES
Mn+C+K-&gt;Sn
Co+Zn+Sc-&gt;Pt
Li+Mg+P+F-&gt;Y


Input

2 1
H H
He


Output

YES
H+H-&gt;He


Input

2 2
Bk Fm
Cf Es


Output

NO

Note

The reactions from the first example possess the following form (the atomic number is written below and to the left of the element):

<image>

<image>

<image>

To find a periodic table of the chemical elements, you may use your favorite search engine.

The pretest set contains each of the first 100 elements of the periodic table at least once. You can use that information to check for misprints.

Solution (in PYTHON):

Solution:
# -*- coding: utf-8 -*-
from collections import defaultdict

syuuki = (('H',1    ),
          ('He', 2  ),
          ('Li',3   ),
          ('Be',4   ),
          ('B',5    ),
          ('C',6    ),
          ('N',7    ),
          ('O',8    ),
          ('F',9    ),
          ('Ne', 10 ),
          ('Na',11  ),
          ('Mg',12  ),
          ('Al',13  ),
          ('Si',14  ),
          ('P',15   ),
          ('S',16   ),
          ('Cl',17  ),
          ('Ar', 18 ),
          ('K', 19  ),
          ('Ca', 20 ),
          ('Sc', 21 ),
          ('Ti', 22 ),
          ('V', 23  ),
          ('Cr', 24 ),
          ('Mn', 25 ),
          ('Fe', 26 ),
          ('Co', 27 ),
          ('Ni', 28 ),
          ('Cu', 29 ),
          ('Zn', 30 ),
          ('Ga', 31 ),
          ('Ge', 32 ),
          ('As', 33 ),
          ('Se', 34 ),
          ('Br', 35 ),
          ('Kr', 36 ),
          ('Rb',37  ),
          ('Sr',38  ),
          ('Y',39   ),
          ('Zr',40  ),
          ('Nb',41  ),
          ('Mo',42  ),
          ('Tc',43  ),
          ('Ru',44  ),
          ('Rh',45  ),
          ('Pd',46  ),
          ('Ag',47  ),
          ('Cd',48  ),
          ('In',49  ),
          ('Sn',50  ),
          ('Sb',51  ),
          ('Te',52  ),
          ('I',53   ),
          ('Xe', 54 ),
          ('Cs',55  ),
          ('Ba',56  ),
          ('Hf',72  ),
          ('Ta',73  ),
          ('W',74   ),
          ('Re',75  ),
          ('Os',76  ),
          ('Ir',77  ),
          ('Pt',78  ),
          ('Au',79  ),
          ('Hg',80  ),
          ('Tl',81  ),
          ('Pb',82  ),
          ('Bi',83  ),
          ('Po',84  ),
          ('At',85  ),
          ('Rn', 86 ),
          ('Fr',87  ),
          ('Ra',88  ),
          ('La', 57 ),
          ('Ce', 58 ),
          ('Pr', 59 ),
          ('Nd', 60 ),
          ('Pm', 61 ),
          ('Sm', 62 ),
          ('Eu', 63 ),
          ('Gd', 64 ),
          ('Tb', 65 ),
          ('Dy', 66 ),
          ('Ho', 67 ),
          ('Er', 68 ),
          ('Tm', 69 ),
          ('Yb', 70 ),
          ('Lu', 71 ),
          ('Ac',89  ),
          ('Th',90  ),
          ('Pa',91  ),
          ('U',92   ),
          ('Np',93  ),
          ('Pu',94  ),
          ('Am',95  ),
          ('Cm',96  ),
          ('Bk',97  ),
          ('Cf',98  ),
          ('Es',99  ),
          ('Fm',100  ),
          )

memo = {}
def dfs(res, hv, used):
    hsh = hash(res, used)
    if memo.has_key(hsh): return memo[hsh]
    seen = set()
    stack = [(res, used)]
    cused = used
    ans = []
    while len(stack):
        cres, cused = stack.pop()
        seen.add(hash(cres, cused))
        if cres == 0:
            ans.append(cused); continue
        for i, ele in enumerate(hv):
            if (cused>>i)&1 or cres - ele < 0 or hash(cres-ele, cused|(1<<i)) in seen: continue
            stack.append((cres - ele, cused|(1<<i)))
    success = 1 if len(ans) else 0
    memo[hsh] = (success, ans)
    return success, ans

n, k = map(int, raw_input().split())
source = raw_input().split()
gen = raw_input().split()

name_num = dict(syuuki)
num_name = dict(zip(name_num.values(), name_num.keys()))

have = sorted([ name_num[no] for no in source ])
goal = [ name_num[no] for no in gen ]
lg = len(goal)
lh = len(have)

seen = set()
for i in range(lg):
    if goal[i] in seen: continue
    inds = [i]
    for j in range(i+1, lg):
        if i == j: continue
        if goal[i] == goal[j]:
            inds.append(j)
    for c, j in enumerate(inds): goal[j] += 1000*c
    seen.add(goal[i])

gr = {}
for i in range(lh):
    if gr.has_key(have[i]): continue
    inds = [ j for j in range(i, lh) if have[i] == have[j] ]
    gr[have[i]] = inds[::]

lgr = len(gr)
grv = gr.values()
gr_items = gr.items()

hsmem = {}
def hash(res, used):
    enc = used*101 + res
    if hsmem.has_key(enc): return hsmem[enc]
    hsh = res*18**lgr
    for d, v in enumerate(grv):
        c = 0
        for i in v:
            if (used>>i)&1: c += 1
        hsh += c*18**d
    hsmem[enc] = hsh
    return hsh

g_exprs_dict = defaultdict(set)
for c, g in enumerate(goal):
    res, ans = dfs(g%1000, have, 0)
    if not res: continue
    for used in ans:
        cmb = []; inds = []
        for i, ele in enumerate(have):
            if not (used>>i)&1: continue
            cmb.append(ele); inds.append(i)
        cmb = tuple(cmb)
        l = len(inds)
        g_exprs_dict[g].add(cmb)

exprs_k = []; exprs_v = []
for k, v in sorted(g_exprs_dict.items(), cmp=lambda x, y: cmp(x[0], y[0])):
    exprs_k.append(k); exprs_v.append(v)

def check_use(status, elems):
    ls = list(elems)
    for i in range(lh):
        if have[i] not in ls or (status>>i)&1 : continue
        status |= 1<<i; ls.remove(have[i])
        if len(ls) == 0: return status
    return None

success = False
if len(exprs_v) == lg:
    q = [ [elems, 0, []] for elems in exprs_v[0] ]
    new_route = []
    while len(q):
        elems, used, route = q.pop()
        used = check_use(used, elems)
        if used is None: continue
        new_route = route[::]; new_route.append(elems)
        route_len = len(new_route)
        if route_len == lg: break
        for next_elems in exprs_v[route_len]:
            q.append([next_elems, used, new_route[::]])
    if len(new_route) == lg:
        success = True
        exprs = [[ num_name[ele] for ele in elems ] for elems in new_route]
if success:
    print 'YES'
    for c, expr in enumerate(exprs):
        print '+'.join(expr) + '->' + num_name[exprs_k[c]%1000]
else:
    print 'NO'