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