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