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