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;
vector<int> v;
vector<int> des;
int n;
bool table[18][18];
char memo[17][102][(1 << 17) + 1];
char f(int ind, int sum, int mask) {
  if (ind == des.size()) return 1;
  if (sum > des[ind]) return 0;
  if (sum == des[ind]) return f(ind + 1, 0, mask);
  char &ret = memo[ind][sum][mask];
  if (ret != -1) return ret;
  char ans = 0;
  for (int(i) = 0; (i) < (n); (i)++) {
    if (!(mask & (1 << i))) {
      table[ind][i] = true;
      int temp = f(ind, sum + v[i], mask | (1 << i));
      if (temp == 1) {
        ans = 1;
        break;
      }
      table[ind][i] = false;
    }
  }
  return ret = ans;
}
int main() {
  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;
  m["Md"] = 101;
  m["No"] = 102;
  m["Lr"] = 103;
  m["Rf"] = 104;
  m["Db"] = 105;
  m["Sg"] = 106;
  m["Bh"] = 107;
  m["Hs"] = 108;
  m["Mt"] = 109;
  m["Ds"] = 110;
  v.clear();
  des.clear();
  int k;
  cin >> n >> k;
  vector<string> s1, s2;
  s1.clear();
  s2.clear();
  for (int(i) = 0; (i) < (n); (i)++) {
    string s;
    cin >> s;
    v.push_back(m[s]);
    s1.push_back(s);
  }
  for (int(i) = 0; (i) < (k); (i)++) {
    string s;
    cin >> s;
    des.push_back(m[s]);
    s2.push_back(s);
  }
  for (int(i) = 0; (i) < (20); (i)++)
    for (int(j) = 0; (j) < (20); (j)++) table[20][20] = false;
  memset((memo), (-1), sizeof(memo));
  int ans = f(0, 0, 0);
  if (ans == 1) {
    cout << "YES" << endl;
    for (int(i) = 0; (i) < (des.size()); (i)++) {
      int ind = 0;
      for (int(j) = 0; (j) < (v.size()); (j)++)
        if (table[i][j]) {
          cout << s1[j];
          ind = j;
          break;
        }
      for (int(j) = (ind + 1); (j) < (v.size()); (j)++)
        if (table[i][j]) cout << "+" << s1[j];
      cout << "->" << s2[i] << endl;
    }
  } else
    cout << "NO" << endl;
}