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