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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
map<string, int> hsh1;
map<int, string> hsh2;
int n, k;
string buf;
int list1[20], list2[20];
struct Package {
  int l, r;
} f[1 << 17];
int pre[1 << 17];
void init();
inline bool operator>(const Package &a, const Package &b) { return a.l > b.l; }
inline int ckmax(Package &a, Package b) { return b > a ? (a = b), 1 : 0; }
inline Package calc(Package &a, int num) {
  Package tmp = a;
  tmp.r += list1[num];
  if (tmp.l < k && tmp.r == list2[tmp.l + 1]) tmp.r = 0, tmp.l++;
  return tmp;
}
void print(int num, int num2) {
  if (f[num].l != num2 && !f[num].r)
    cout << "->" << hsh2[list2[num2--]] << endl;
  else if (num < (1 << n) - 1)
    cout << "+";
  if (!num) return;
  cout << hsh2[list1[__builtin_ctz(num ^ pre[num]) + 1]];
  print(pre[num], num2);
}
int main() {
  init();
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> buf, list1[i] = hsh1[buf];
  for (int i = 1; i <= k; i++) cin >> buf, list2[i] = hsh1[buf];
  memset(f, 0xff, sizeof(f));
  f[0].l = f[0].r = 0;
  for (int i = 0; i < (1 << n); i++)
    for (int j = 1; j <= n; j++)
      if (!(i & (1 << j - 1)))
        if (ckmax(f[i | (1 << j - 1)], calc(f[i], j)))
          pre[i | (1 << j - 1)] = i;
  if (f[(1 << n) - 1].l != k || f[(1 << n) - 1].r != 0)
    return (cout << "NO\n"), 0;
  cout << "YES\n";
  print((1 << n) - 1, k);
  return 0;
}
void init() {
  hsh2[hsh1["H"] = 1] = "H";
  hsh2[hsh1["He"] = 2] = "He";
  hsh2[hsh1["Li"] = 3] = "Li";
  hsh2[hsh1["Be"] = 4] = "Be";
  hsh2[hsh1["B"] = 5] = "B";
  hsh2[hsh1["C"] = 6] = "C";
  hsh2[hsh1["N"] = 7] = "N";
  hsh2[hsh1["O"] = 8] = "O";
  hsh2[hsh1["F"] = 9] = "F";
  hsh2[hsh1["Ne"] = 10] = "Ne";
  hsh2[hsh1["Na"] = 11] = "Na";
  hsh2[hsh1["Mg"] = 12] = "Mg";
  hsh2[hsh1["Al"] = 13] = "Al";
  hsh2[hsh1["Si"] = 14] = "Si";
  hsh2[hsh1["P"] = 15] = "P";
  hsh2[hsh1["S"] = 16] = "S";
  hsh2[hsh1["Cl"] = 17] = "Cl";
  hsh2[hsh1["Ar"] = 18] = "Ar";
  hsh2[hsh1["K"] = 19] = "K";
  hsh2[hsh1["Ca"] = 20] = "Ca";
  hsh2[hsh1["Sc"] = 21] = "Sc";
  hsh2[hsh1["Ti"] = 22] = "Ti";
  hsh2[hsh1["V"] = 23] = "V";
  hsh2[hsh1["Cr"] = 24] = "Cr";
  hsh2[hsh1["Mn"] = 25] = "Mn";
  hsh2[hsh1["Fe"] = 26] = "Fe";
  hsh2[hsh1["Co"] = 27] = "Co";
  hsh2[hsh1["Ni"] = 28] = "Ni";
  hsh2[hsh1["Cu"] = 29] = "Cu";
  hsh2[hsh1["Zn"] = 30] = "Zn";
  hsh2[hsh1["Ga"] = 31] = "Ga";
  hsh2[hsh1["Ge"] = 32] = "Ge";
  hsh2[hsh1["As"] = 33] = "As";
  hsh2[hsh1["Se"] = 34] = "Se";
  hsh2[hsh1["Br"] = 35] = "Br";
  hsh2[hsh1["Kr"] = 36] = "Kr";
  hsh2[hsh1["Rb"] = 37] = "Rb";
  hsh2[hsh1["Sr"] = 38] = "Sr";
  hsh2[hsh1["Y"] = 39] = "Y";
  hsh2[hsh1["Zr"] = 40] = "Zr";
  hsh2[hsh1["Nb"] = 41] = "Nb";
  hsh2[hsh1["Mo"] = 42] = "Mo";
  hsh2[hsh1["Tc"] = 43] = "Tc";
  hsh2[hsh1["Ru"] = 44] = "Ru";
  hsh2[hsh1["Rh"] = 45] = "Rh";
  hsh2[hsh1["Pd"] = 46] = "Pd";
  hsh2[hsh1["Ag"] = 47] = "Ag";
  hsh2[hsh1["Cd"] = 48] = "Cd";
  hsh2[hsh1["In"] = 49] = "In";
  hsh2[hsh1["Sn"] = 50] = "Sn";
  hsh2[hsh1["Sb"] = 51] = "Sb";
  hsh2[hsh1["Te"] = 52] = "Te";
  hsh2[hsh1["I"] = 53] = "I";
  hsh2[hsh1["Xe"] = 54] = "Xe";
  hsh2[hsh1["Cs"] = 55] = "Cs";
  hsh2[hsh1["Ba"] = 56] = "Ba";
  hsh2[hsh1["La"] = 57] = "La";
  hsh2[hsh1["Ce"] = 58] = "Ce";
  hsh2[hsh1["Pr"] = 59] = "Pr";
  hsh2[hsh1["Nd"] = 60] = "Nd";
  hsh2[hsh1["Pm"] = 61] = "Pm";
  hsh2[hsh1["Sm"] = 62] = "Sm";
  hsh2[hsh1["Eu"] = 63] = "Eu";
  hsh2[hsh1["Gd"] = 64] = "Gd";
  hsh2[hsh1["Tb"] = 65] = "Tb";
  hsh2[hsh1["Dy"] = 66] = "Dy";
  hsh2[hsh1["Ho"] = 67] = "Ho";
  hsh2[hsh1["Er"] = 68] = "Er";
  hsh2[hsh1["Tm"] = 69] = "Tm";
  hsh2[hsh1["Yb"] = 70] = "Yb";
  hsh2[hsh1["Lu"] = 71] = "Lu";
  hsh2[hsh1["Hf"] = 72] = "Hf";
  hsh2[hsh1["Ta"] = 73] = "Ta";
  hsh2[hsh1["W"] = 74] = "W";
  hsh2[hsh1["Re"] = 75] = "Re";
  hsh2[hsh1["Os"] = 76] = "Os";
  hsh2[hsh1["Ir"] = 77] = "Ir";
  hsh2[hsh1["Pt"] = 78] = "Pt";
  hsh2[hsh1["Au"] = 79] = "Au";
  hsh2[hsh1["Hg"] = 80] = "Hg";
  hsh2[hsh1["Tl"] = 81] = "Tl";
  hsh2[hsh1["Pb"] = 82] = "Pb";
  hsh2[hsh1["Bi"] = 83] = "Bi";
  hsh2[hsh1["Po"] = 84] = "Po";
  hsh2[hsh1["At"] = 85] = "At";
  hsh2[hsh1["Rn"] = 86] = "Rn";
  hsh2[hsh1["Fr"] = 87] = "Fr";
  hsh2[hsh1["Ra"] = 88] = "Ra";
  hsh2[hsh1["Ac"] = 89] = "Ac";
  hsh2[hsh1["Th"] = 90] = "Th";
  hsh2[hsh1["Pa"] = 91] = "Pa";
  hsh2[hsh1["U"] = 92] = "U";
  hsh2[hsh1["Np"] = 93] = "Np";
  hsh2[hsh1["Pu"] = 94] = "Pu";
  hsh2[hsh1["Am"] = 95] = "Am";
  hsh2[hsh1["Cm"] = 96] = "Cm";
  hsh2[hsh1["Bk"] = 97] = "Bk";
  hsh2[hsh1["Cf"] = 98] = "Cf";
  hsh2[hsh1["Es"] = 99] = "Es";
  hsh2[hsh1["Fm"] = 100] = "Fm";
}