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 char* table =
    "H1 "
    "He2 "
    "Li3	Be4 "
    "B5	C6	N7	O8	F9	Ne10 "
    "Na11	Mg12 "
    "Al13	Si14	P15	S16	Cl17	Ar18 "
    "K19	Ca20	Sc21	Ti22	V23	Cr24	Mn25	Fe26	"
    "Co27	Ni28	Cu29	Zn30	Ga31	Ge32	As33	Se34	"
    "Br35	Kr36 "
    "Rb37	Sr38	Y39	Zr40	Nb41	Mo42	Tc43	Ru44	"
    "Rh45	Pd46	Ag47	Cd48	In49	Sn50	Sb51	Te52	"
    "I53	Xe54 "
    "Cs55	Ba56	La57	Hf72	Ta73	W74	Re75	Os76	"
    "Ir77	Pt78	Au79	Hg80	Tl81	Pb82	Bi83	Po84	"
    "At85	Rn86 "
    "Fr87	Ra88	Ac89 "
    "Ce58	Pr59	Nd60	Pm61	Sm62	Eu63	Gd64	Tb65	"
    "Dy66	Ho67	Er68	Tm69	Yb70	Lu71 "
    "Th90	Pa91	U92	Np93 	Pu94 	Am95	Cm96 	Bk97	Cf98 "
    "	Es99	Fm100	Md101";
map<string, int> pm;
map<int, string> mp;
int dpf[1 << 18];
int dps[1 << 18];
void init() {
  stringstream ss, num;
  ss << table;
  string f;
  while (ss >> f) {
    int n = 0, j = (int)f.length();
    while (isdigit(f[--j]))
      ;
    num.clear();
    num << f.substr(j + 1);
    num >> n;
    f = f.substr(0, j + 1);
    pm[f] = n;
    mp[n] = f;
  }
}
struct CmpFirstLength {
  CmpFirstLength(int n) : n_(n) {}
  bool operator()(const pair<int, int>& lhs, const pair<int, int>& rhs) const {
    if (lhs.first == rhs.first && n_ > 0) {
      int l = 0, r = 0;
      for (int i = 0; i < n_; ++i) {
        l += (lhs.second >> i & 1) != 0;
        r += (rhs.second >> i & 1) != 0;
      }
      return l < r;
    }
    return lhs.first < rhs.first;
  }

 private:
  int n_;
};
struct CmpByCount {
  CmpByCount(vector<int>& to, vector<int>& cnt) : to_(&to), cnt_(&cnt) {}
  bool operator()(int lhs, int rhs) const {
    size_t l = lower_bound(to_->begin(), to_->end(), lhs) - to_->begin();
    size_t r = lower_bound(to_->begin(), to_->end(), rhs) - to_->begin();
    return (*cnt_)[l] < (*cnt_)[r];
  }

 private:
  vector<int>* to_;
  vector<int>* cnt_;
};
bool dfs(int k, const vector<pair<int, int> >& data,
         const vector<pair<int, int> >& ranges, int used, vector<int>& mask,
         const vector<int>& to) {
  if (k == (int)to.size()) return true;
  for (int i = ranges[k].first; i < ranges[k].second; ++i) {
    int nused = used;
    if ((nused & data[i].second) != 0) continue;
    nused |= mask[k] = data[i].second;
    if (dfs(k + 1, data, ranges, nused, mask, to)) return true;
    mask[k] = 0;
  }
  return false;
}
vector<int> solve(vector<int> from, vector<int> to) {
  int n = (int)from.size(), k = (int)to.size();
  vector<pair<int, int> > data, ranges(k);
  vector<int> cnt(k);
  sort(to.begin(), to.end());
  for (int i = 0; i < (1 << n); ++i) {
    int sum = 0;
    for (int j = 0; j < n; ++j)
      if (i >> j & 1) sum += from[j];
    if (binary_search(to.begin(), to.end(), sum)) {
      data.push_back(make_pair(sum, i));
      ++cnt[lower_bound(to.begin(), to.end(), sum) - to.begin()];
    }
  }
  vector<int> tmp = to;
  sort(to.begin(), to.end(), CmpByCount(tmp, cnt));
  sort(data.begin(), data.end(), CmpFirstLength(n));
  for (int i = 0; i < k; ++i) {
    pair<vector<pair<int, int> >::iterator, vector<pair<int, int> >::iterator>
        range = equal_range(data.begin(), data.end(), make_pair(to[i], 0),
                            CmpFirstLength(-1));
    ranges[i] =
        make_pair(range.first - data.begin(), range.second - data.begin());
  }
  vector<int> ans(k, 0);
  if (!dfs(0, data, ranges, 0, ans, to)) return vector<int>();
  return ans;
}
int main() {
  init();
  int n, k;
  cin >> n >> k;
  string s;
  vector<int> from(n), to(k);
  for (int i = 0; i < n; ++i) {
    cin >> s;
    from[i] = pm[s];
  }
  for (int i = 0; i < k; ++i) {
    cin >> s;
    to[i] = pm[s];
  }
  if (*max_element(from.begin(), from.end()) >
      *max_element(to.begin(), to.end())) {
    cout << "NO" << endl;
    return 0;
  }
  vector<int> ans = solve(from, to);
  if (ans.empty()) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    for (int i = 0; i < k; ++i) {
      int sum = 0;
      for (int j = 0, g = 0; j < n; ++j)
        if (ans[i] >> j & 1) {
          if (g != 0) cout << "+";
          cout << mp[from[j]];
          sum += from[j], ++g;
        }
      cout << "->" << mp[sum] << endl;
    }
  }
  return 0;
}