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;
double v, d, u;
int INFINIT = 10000000;
int n, r, k;
int t;
int cur = 0;
map<string, int> periodic_table;
vector<vector<string> > res2(20);
vector<int> sizes(20);
vector<string> res(20);
vector<string> atoms(20);
vector<string> targ(20);
vector<string> sub_res;
int dp[131073][20];
int sol(int rem, int index, int ind, int level, int mask) {
  if (rem == 0) {
    if (level == (k - 1)) {
      if (!cur) {
        cout << "YES" << endl;
        for (int i = 0; i < k - 1; i++) {
          cout << res2[i][0];
          for (int j = 1; j < sizes[i]; j++) {
            cout << "+" << res2[i][j];
          }
          cout << "->" << targ[i] << endl;
        }
        cout << res2[level][0];
        for (int i = 1; i < ind; i++) {
          cout << "+" << res2[level][i];
        }
        cout << "->" << targ[level] << endl;
      }
      cur++;
    }
    sizes[level] = ind;
    if (level < (k - 1)) {
      if (!cur) {
        return sol(periodic_table[targ[level + 1]], 0, 0, level + 1, mask);
      }
    }
    return 0;
  }
  if (index == n || rem < 0) {
    return INFINIT;
  }
  if (dp[mask][level] != -1) {
    return dp[mask][level];
  }
  int way1 = INFINIT;
  int way2 = INFINIT;
  if ((mask & (1 << index)) == 0) {
    res2[level][ind] = atoms[index];
    way1 = sol(rem - periodic_table[atoms[index]], index + 1, ind + 1, level,
               mask | (1 << index));
    way2 = sol(rem, index + 1, ind, level, mask);
  } else {
    return sol(rem, index + 1, ind, level, mask);
  }
  return dp[mask][level] = min(way1, way2);
}
int main() {
  periodic_table["H"] = 1;
  periodic_table["He"] = 2;
  periodic_table["Li"] = 3;
  periodic_table["Be"] = 4;
  periodic_table["B"] = 5;
  periodic_table["C"] = 6;
  periodic_table["N"] = 7;
  periodic_table["O"] = 8;
  periodic_table["F"] = 9;
  periodic_table["Ne"] = 10;
  periodic_table["Na"] = 11;
  periodic_table["Mg"] = 12;
  periodic_table["Al"] = 13;
  periodic_table["Si"] = 14;
  periodic_table["P"] = 15;
  periodic_table["S"] = 16;
  periodic_table["Cl"] = 17;
  periodic_table["Ar"] = 18;
  periodic_table["K"] = 19;
  periodic_table["Ca"] = 20;
  periodic_table["Sc"] = 21;
  periodic_table["Ti"] = 22;
  periodic_table["V"] = 23;
  periodic_table["Cr"] = 24;
  periodic_table["Mn"] = 25;
  periodic_table["Fe"] = 26;
  periodic_table["Co"] = 27;
  periodic_table["Ni"] = 28;
  periodic_table["Cu"] = 29;
  periodic_table["Zn"] = 30;
  periodic_table["Ga"] = 31;
  periodic_table["Ge"] = 32;
  periodic_table["As"] = 33;
  periodic_table["Se"] = 34;
  periodic_table["Br"] = 35;
  periodic_table["Kr"] = 36;
  periodic_table["Rb"] = 37;
  periodic_table["Sr"] = 38;
  periodic_table["Y"] = 39;
  periodic_table["Zr"] = 40;
  periodic_table["Nb"] = 41;
  periodic_table["Mo"] = 42;
  periodic_table["Tc"] = 43;
  periodic_table["Ru"] = 44;
  periodic_table["Rh"] = 45;
  periodic_table["Pd"] = 46;
  periodic_table["Ag"] = 47;
  periodic_table["Cd"] = 48;
  periodic_table["In"] = 49;
  periodic_table["Sn"] = 50;
  periodic_table["Sb"] = 51;
  periodic_table["Te"] = 52;
  periodic_table["I"] = 53;
  periodic_table["Xe"] = 54;
  periodic_table["Cs"] = 55;
  periodic_table["Ba"] = 56;
  periodic_table["La"] = 57;
  periodic_table["Ce"] = 58;
  periodic_table["Pr"] = 59;
  periodic_table["Nd"] = 60;
  periodic_table["Pm"] = 61;
  periodic_table["Sm"] = 62;
  periodic_table["Eu"] = 63;
  periodic_table["Gd"] = 64;
  periodic_table["Tb"] = 65;
  periodic_table["Dy"] = 66;
  periodic_table["Ho"] = 67;
  periodic_table["Er"] = 68;
  periodic_table["Tm"] = 69;
  periodic_table["Yb"] = 70;
  periodic_table["Lu"] = 71;
  periodic_table["Hf"] = 72;
  periodic_table["Ta"] = 73;
  periodic_table["W"] = 74;
  periodic_table["Re"] = 75;
  periodic_table["Os"] = 76;
  periodic_table["Ir"] = 77;
  periodic_table["Pt"] = 78;
  periodic_table["Au"] = 79;
  periodic_table["Hg"] = 80;
  periodic_table["Tl"] = 81;
  periodic_table["Pb"] = 82;
  periodic_table["Bi"] = 83;
  periodic_table["Po"] = 84;
  periodic_table["At"] = 85;
  periodic_table["Rn"] = 86;
  periodic_table["Fr"] = 87;
  periodic_table["Ra"] = 88;
  periodic_table["Ac"] = 89;
  periodic_table["Th"] = 90;
  periodic_table["Pa"] = 91;
  periodic_table["U"] = 92;
  periodic_table["Np"] = 93;
  periodic_table["Pu"] = 94;
  periodic_table["Am"] = 95;
  periodic_table["Cm"] = 96;
  periodic_table["Bk"] = 97;
  periodic_table["Cf"] = 98;
  periodic_table["Es"] = 99;
  periodic_table["Fm"] = 100;
  for (int i = 0; i < 20; i++) {
    res2[i].resize(20);
  }
  memset(dp, -1, sizeof(dp));
  cin >> n >> k;
  string em;
  getline(cin, em);
  for (int i = 0; i < n; i++) {
    string in;
    cin >> in;
    atoms[i] = in;
  }
  for (int i = 0; i < k; i++) {
    cin >> targ[i];
  }
  int out = sol(periodic_table[targ[0]], 0, 0, 0, 0);
  if (out) {
    cout << "NO" << endl;
  }
  return 0;
}