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