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