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