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;
const int INF = 1000000002;
const long long INFLL = 100000000000000001ll;
const long long MOD = 1000000007;
bool DP[19][135000];
int From[19][135000];
int N, M, A[20], B[20];
map<string, int> Map;
string AS[20], BS[20];
vector<int> E[20];
int main() {
  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;
  cin >> N >> M;
  for (int i = (0); i <= (N - 1); i++) {
    string s;
    cin >> s;
    AS[i] = s;
    A[i] = Map[s];
  }
  for (int i = (0); i <= (M - 1); i++) {
    string s;
    cin >> s;
    BS[i] = s;
    B[i] = Map[s];
  }
  for (int m = (0); m <= ((1 << N) - 1); m++) {
    int val = 0;
    for (int i = (0); i <= (N - 1); i++)
      if (m & (1 << i)) val += A[i];
    for (int i = (0); i <= (M - 1); i++)
      if (val == B[i]) E[i].push_back(m);
  }
  DP[0][0] = true;
  for (int i = (0); i <= (M - 1); i++)
    for (int m = (0); m <= ((1 << N) - 1); m++) {
      if (!DP[i][m]) continue;
      for (int mask : E[i])
        if ((m & mask) == 0) {
          DP[i + 1][m + mask] = true;
          From[i + 1][m + mask] = mask;
        }
    }
  if (DP[M][(1 << N) - 1]) {
    cout << "YES\n";
    int i = M;
    int m = (1 << N) - 1;
    while (m > 0) {
      vector<string> v;
      int mask = From[i][m];
      for (int x = (0); x <= (N - 1); x++)
        if (mask & (1 << x)) v.push_back(AS[x]);
      for (int x = (0); x <= (((int)v.size()) - 2); x++) cout << v[x] << "+";
      cout << v.back() << "->" << BS[i - 1] << "\n";
      m -= From[i][m];
      i--;
    }
  } else
    cout << "NO";
}