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;
void fun() {}
long long int md = 1e9 + 7;
long long int __gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return __gcd(b, a % b);
}
long long int poww(long long int a, long long int b, long long int md) {
  if (b < 0) return 0;
  if (a == 0) return 0;
  long long int res = 1;
  while (b) {
    if (b & 1) {
      res = (1ll * res * a) % md;
    }
    a = (1ll * a * a) % md;
    b >>= 1;
  }
  return res;
}
long long int poww(long long int a, long long int b) {
  if (b < 0) return 0;
  if (a == 0) return 0;
  long long int res = 1;
  while (b) {
    if (b & 1) {
      res = (1ll * res * a);
    }
    a = (1ll * a * a);
    b >>= 1;
  }
  return res;
}
void ainp(long long int arr[], long long int n) {
  for (long long int i = 1; i <= n; i++) cin >> arr[i];
}
long long int divide(long long int a, long long int b, long long int md) {
  long long int rr = a * (poww(b, md - 2, md));
  rr %= md;
  return rr;
}
string s[] = {"",   "H",  "He", "Li", "Be", "B",  "C",  "N",  "O",  "F",  "Ne",
              "Na", "Mg", "Al", "Si", "P",  "S",  "Cl", "Ar", "K",  "Ca", "Sc",
              "Ti", "V",  "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn", "Ga", "Ge",
              "As", "Se", "Br", "Kr", "Rb", "Sr", "Y",  "Zr", "Nb", "Mo", "Tc",
              "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn", "Sb", "Te", "I",  "Xe",
              "Cs", "Ba", "La", "Ce", "Pr", "Nd", "Pm", "Sm", "Eu", "Gd", "Tb",
              "Dy", "Ho", "Er", "Tm", "Yb", "Lu", "Hf", "Ta", "W",  "Re", "Os",
              "Ir", "Pt", "Au", "Hg", "Tl", "Pb", "Bi", "Po", "At", "Rn", "Fr",
              "Ra", "Ac", "Th", "Pa", "U",  "Np", "Pu", "Am", "Cm", "Bk", "Cf",
              "Es", "Fm"};
map<string, long long int> mapp;
long long int n, k;
const long long int size = 17;
long long int karr[size];
long long int arr[size];
long long int sum[1 << size];
long long int dp[1 << size], retrace[1 << size];
void pre() {
  for (long long int i = 1; i <= 100; i++) mapp[s[i]] = i;
}
void initsum() {
  for (long long int mask = 0; mask < (1 << n); mask++)
    for (long long int i = 0; i < n; i++)
      if (mask & (1 << i)) sum[mask] += arr[i];
}
void initdp() {
  dp[0] = 0;
  for (long long int mask = 0; mask < (1 << n); mask++) {
    if (dp[mask] == -1) continue;
    long long int invmask = (~mask) & ((1 << n) - 1);
    for (long long int submask = invmask; submask > 0;
         submask = invmask & (submask - 1)) {
      if (sum[submask] == karr[dp[mask]]) {
        dp[mask ^ submask] = dp[mask] + 1;
        retrace[mask ^ submask] = mask;
      }
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  fun();
  pre();
  cin >> n >> k;
  string p;
  for (long long int i = 0; i < n; i++) cin >> p, arr[i] = mapp[p];
  for (long long int i = 0; i < k; i++) cin >> p, karr[i] = mapp[p];
  initsum();
  memset(dp, -1, sizeof(dp));
  memset(retrace, -1, sizeof(retrace));
  initdp();
  if (dp[(1 << n) - 1] == k) {
    long long int ind = k - 1;
    cout << "YES\n";
    long long int mask = (1 << n) - 1;
    while (mask != 0) {
      long long int req = mask ^ retrace[mask];
      vector<string> v;
      for (long long int i = 0; i < n; i++)
        if (req & (1 << i)) v.push_back(s[arr[i]]);
      for (long long int i = 0; i < v.size(); i++) {
        if (i) cout << "+";
        cout << v[i];
      }
      cout << "->" << s[karr[ind--]] << "\n";
      mask = retrace[mask];
    }
  } else
    cout << "NO\n";
  return 0;
}