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