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