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> mp;
string getName(int id) {
  for (map<string, int>::iterator i = mp.begin(); i != mp.end(); i++) {
    if (i->second == id) return i->first;
  }
}
string name[20], final[20];
const int N = 17;
const int MAXR = (1 << 17);
const int MAXC = N + N;
const int TOTAL = (MAXR + 1) * (MAXC + 1);
const int MAXV = 0x3F3F3F3F;
pair<int, int> state[MAXR];
int n, m, mat[MAXR][MAXC];
int cid[TOTAL], rid[TOTAL], s[MAXC];
int res[MAXR];
int l[TOTAL], r[TOTAL], u[TOTAL], d[TOTAL];
int lastc[MAXC];
void remove(const int& col) {
  l[r[col]] = l[col];
  r[l[col]] = r[col];
  for (int i = d[col]; i != col; i = d[i]) {
    for (int j = r[i]; j != i; j = r[j]) {
      d[u[j]] = d[j];
      u[d[j]] = u[j];
      s[cid[j]]--;
    }
  }
}
void resume(const int& col) {
  for (int i = u[col]; i != col; i = u[i]) {
    for (int j = l[i]; j != i; j = l[j]) {
      d[u[j]] = j;
      u[d[j]] = j;
      s[cid[j]]++;
    }
  }
  l[r[col]] = col;
  r[l[col]] = col;
}
inline void addlr(const int& ln, const int& rn) {
  l[r[ln]] = rn;
  r[rn] = r[ln];
  r[ln] = rn;
  l[rn] = ln;
}
inline void addud(const int& un, const int& dn) {
  u[d[un]] = dn;
  d[dn] = d[un];
  d[un] = dn;
  u[dn] = un;
}
bool dfs(int k) {
  if (r[0] == 0) {
    puts("YES");
    int mystate, myid;
    for (int i = 1; i < k; i++) {
      int w = 0;
      mystate = state[res[i]].first;
      myid = state[res[i]].second;
      for (int j = 0; j < n; j++) {
        if (mystate & (1 << j)) {
          if (w++) putchar('+');
          cout << name[j];
        }
      }
      cout << "->" << final[myid] << "\n";
    }
    return true;
  }
  int c, minv = MAXV;
  for (int i = r[0]; i != 0; i = r[i]) {
    if (s[i] < minv) {
      minv = s[i];
      c = i;
    }
  }
  if (minv == 0) return false;
  remove(c);
  for (int i = d[c]; i != c; i = d[i]) {
    res[k] = rid[i];
    for (int j = r[i]; j != i; j = r[j]) remove(cid[j]);
    if (dfs(k + 1)) return true;
    for (int j = l[i]; j != i; j = l[j]) resume(cid[j]);
  }
  resume(c);
  return false;
}
void adapt(int n, int m) {
  memset(s, 0, sizeof(s));
  l[0] = r[0] = 0;
  for (int i = 1; i <= m; i++) {
    addlr(i - 1, i);
    u[i] = d[i] = i;
    lastc[i] = i;
  }
  int ind = m + 1;
  for (int i = 1; i <= n; i++) {
    bool isfirst = true;
    for (int j = 1; j <= m; j++) {
      if (mat[i][j]) {
        if (isfirst) {
          isfirst = false;
          l[ind] = r[ind] = ind;
        } else {
          addlr(ind - 1, ind);
        }
        addud(lastc[j], ind);
        lastc[j] = ind;
        rid[ind] = i;
        cid[ind] = j;
        s[j]++;
        ind++;
      }
    }
  }
}
int main() {
  mp["H"] = 1;
  mp["He"] = 2;
  mp["Li"] = 3;
  mp["Be"] = 4;
  mp["B"] = 5;
  mp["C"] = 6;
  mp["N"] = 7;
  mp["O"] = 8;
  mp["F"] = 9;
  mp["Ne"] = 10;
  mp["Na"] = 11;
  mp["Mg"] = 12;
  mp["Al"] = 13;
  mp["Si"] = 14;
  mp["P"] = 15;
  mp["S"] = 16;
  mp["Cl"] = 17;
  mp["Ar"] = 18;
  mp["K"] = 19;
  mp["Ca"] = 20;
  mp["Sc"] = 21;
  mp["Ti"] = 22;
  mp["V"] = 23;
  mp["Cr"] = 24;
  mp["Mn"] = 25;
  mp["Fe"] = 26;
  mp["Co"] = 27;
  mp["Ni"] = 28;
  mp["Cu"] = 29;
  mp["Zn"] = 30;
  mp["Ga"] = 31;
  mp["Ge"] = 32;
  mp["As"] = 33;
  mp["Se"] = 34;
  mp["Br"] = 35;
  mp["Kr"] = 36;
  mp["Rb"] = 37;
  mp["Sr"] = 38;
  mp["Y"] = 39;
  mp["Zr"] = 40;
  mp["Nb"] = 41;
  mp["Mo"] = 42;
  mp["Tc"] = 43;
  mp["Ru"] = 44;
  mp["Rh"] = 45;
  mp["Pd"] = 46;
  mp["Ag"] = 47;
  mp["Cd"] = 48;
  mp["In"] = 49;
  mp["Sn"] = 50;
  mp["Sb"] = 51;
  mp["Te"] = 52;
  mp["I"] = 53;
  mp["Xe"] = 54;
  mp["Cs"] = 55;
  mp["Ba"] = 56;
  mp["La"] = 57;
  mp["Ce"] = 58;
  mp["Pr"] = 59;
  mp["Nd"] = 60;
  mp["Pm"] = 61;
  mp["Sm"] = 62;
  mp["Eu"] = 63;
  mp["Gd"] = 64;
  mp["Tb"] = 65;
  mp["Dy"] = 66;
  mp["Ho"] = 67;
  mp["Er"] = 68;
  mp["Tm"] = 69;
  mp["Yb"] = 70;
  mp["Lu"] = 71;
  mp["Hf"] = 72;
  mp["Ta"] = 73;
  mp["W"] = 74;
  mp["Re"] = 75;
  mp["Os"] = 76;
  mp["Ir"] = 77;
  mp["Pt"] = 78;
  mp["Au"] = 79;
  mp["Hg"] = 80;
  mp["Tl"] = 81;
  mp["Pb"] = 82;
  mp["Bi"] = 83;
  mp["Po"] = 84;
  mp["At"] = 85;
  mp["Rn"] = 86;
  mp["Fr"] = 87;
  mp["Ra"] = 88;
  mp["Ac"] = 89;
  mp["Th"] = 90;
  mp["Pa"] = 91;
  mp["U"] = 92;
  mp["Np"] = 93;
  mp["Pu"] = 94;
  mp["Am"] = 95;
  mp["Cm"] = 96;
  mp["Bk"] = 97;
  mp["Cf"] = 98;
  mp["Es"] = 99;
  mp["Fm"] = 100;
  while (cin >> n >> m) {
    memset(mat, 0, sizeof(mat));
    for (int i = 0; i < n; i++) cin >> name[i];
    for (int i = 1; i <= m; i++) cin >> final[i];
    int r = 0;
    for (int i = 1; i < (1 << n); i++) {
      int total = 0;
      for (int j = 0; j < n; j++) {
        if (i & (1 << j)) total += mp[name[j]];
      }
      string fuck = getName(total);
      for (int j = 1; j <= m; j++) {
        if (fuck == final[j]) {
          r++;
          state[r] = make_pair(i, j);
          mat[r][j] = 1;
          for (int k = 0; k < n; k++) {
            if (i & (1 << k)) {
              mat[r][m + k + 1] = 1;
            }
          }
        }
      }
    }
    adapt(r, m + n);
    if (!dfs(1)) puts("NO");
  }
  return 0;
}