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>
static inline int popcount(int x) { return __builtin_popcount(x); }
template <class T, class U>
static inline std::pair<T, U> mp(const T& a, const U& b) {
  return std::make_pair(a, b);
}
std::map<std::string, int> S;
std::map<int, std::string> back;
void make_map() {
  S["H"] = 1;
  S["He"] = 2;
  S["Li"] = 3;
  S["Be"] = 4;
  S["B"] = 5;
  S["C"] = 6;
  S["N"] = 7;
  S["O"] = 8;
  S["F"] = 9;
  S["Ne"] = 10;
  S["Na"] = 11;
  S["Mg"] = 12;
  S["Al"] = 13;
  S["Si"] = 14;
  S["P"] = 15;
  S["S"] = 16;
  S["Cl"] = 17;
  S["Ar"] = 18;
  S["K"] = 19;
  S["Ca"] = 20;
  S["Sc"] = 21;
  S["Ti"] = 22;
  S["V"] = 23;
  S["Cr"] = 24;
  S["Mn"] = 25;
  S["Fe"] = 26;
  S["Co"] = 27;
  S["Ni"] = 28;
  S["Cu"] = 29;
  S["Zn"] = 30;
  S["Ga"] = 31;
  S["Ge"] = 32;
  S["As"] = 33;
  S["Se"] = 34;
  S["Br"] = 35;
  S["Kr"] = 36;
  S["Rb"] = 37;
  S["Sr"] = 38;
  S["Y"] = 39;
  S["Zr"] = 40;
  S["Nb"] = 41;
  S["Mo"] = 42;
  S["Tc"] = 43;
  S["Ru"] = 44;
  S["Rh"] = 45;
  S["Pd"] = 46;
  S["Ag"] = 47;
  S["Cd"] = 48;
  S["In"] = 49;
  S["Sn"] = 50;
  S["Sb"] = 51;
  S["Te"] = 52;
  S["I"] = 53;
  S["Xe"] = 54;
  S["Cs"] = 55;
  S["Ba"] = 56;
  S["La"] = 57;
  S["Ce"] = 58;
  S["Pr"] = 59;
  S["Nd"] = 60;
  S["Pm"] = 61;
  S["Sm"] = 62;
  S["Eu"] = 63;
  S["Gd"] = 64;
  S["Tb"] = 65;
  S["Dy"] = 66;
  S["Ho"] = 67;
  S["Er"] = 68;
  S["Tm"] = 69;
  S["Yb"] = 70;
  S["Lu"] = 71;
  S["Hf"] = 72;
  S["Ta"] = 73;
  S["W"] = 74;
  S["Re"] = 75;
  S["Os"] = 76;
  S["Ir"] = 77;
  S["Pt"] = 78;
  S["Au"] = 79;
  S["Hg"] = 80;
  S["Tl"] = 81;
  S["Pb"] = 82;
  S["Bi"] = 83;
  S["Po"] = 84;
  S["At"] = 85;
  S["Rn"] = 86;
  S["Fr"] = 87;
  S["Ra"] = 88;
  S["Ac"] = 89;
  S["Th"] = 90;
  S["Pa"] = 91;
  S["U"] = 92;
  S["Np"] = 93;
  S["Pu"] = 94;
  S["Am"] = 95;
  S["Cm"] = 96;
  S["Bk"] = 97;
  S["Cf"] = 98;
  S["Es"] = 99;
  S["Fm"] = 100;
  S["Md"] = 101;
  for (auto itr = S.begin(); itr != S.end(); itr++)
    back[itr->second] = itr->first;
}
static constexpr int MAXN = 17;
static int dp[1 << MAXN][MAXN];
static std::vector<int> start;
static std::vector<int> end;
static std::map<int, std::vector<int>> sums;
static int solve(int mask, int index) {
  if (index < 0) return popcount(mask) == 0;
  if (popcount(mask) == 0) {
    if (index < 0) return 1;
    return 0;
  }
  int& ref = dp[mask][index];
  if (ref == -1) {
    const std::vector<int>& choices = sums[end[index]];
    ref = 0;
    for (int dumb : choices) {
      bool flag = true;
      for (int i = 0; i < start.size(); i++) {
        if (dumb & (1 << i)) flag = flag && (mask & (1 << i));
        if (!flag) break;
      }
      if (!flag) continue;
      ref = ref || solve(mask & ~dumb, index - 1);
      if (ref) {
        return ref;
      }
    }
  }
  return ref;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  make_map();
  int size1, size2;
  std::cin >> size1 >> size2;
  for (int i = 0; i < size1; i++) {
    std::string next;
    std::cin >> next;
    start.push_back(S[next]);
  }
  for (int i = 0; i < size2; i++) {
    std::string next;
    std::cin >> next;
    end.push_back(S[next]);
  }
  for (int i = 0; i < (1 << size1); i++) {
    int sum = 0;
    for (int j = 0; j < size1; j++) {
      if (i & (1 << j)) {
        sum += start[j];
      }
    }
    for (int j = 0; j < size2; j++) {
      if (end[j] == sum) {
        sums[sum].push_back(i);
        break;
      }
    }
  }
  std::memset(dp, -1, sizeof(dp));
  if (!solve((1 << size1) - 1, size2 - 1)) {
    std::cout << "NO\n";
    return 0;
  }
  std::cout << "YES\n";
  std::vector<std::string> answer;
  int mask = (1 << size1) - 1;
  int index = size2 - 1;
  while (index >= 0) {
    int chosen = -1;
    for (int i : sums[end[index]]) {
      bool flag = true;
      for (int j = 0; j < size1; j++) {
        if (i & (1 << j)) flag = flag && (mask & (1 << j));
        if (!flag) break;
      }
      if (!flag) continue;
      if (solve(mask & ~i, index - 1)) {
        chosen = i;
        break;
      }
    }
    assert(chosen != -1);
    answer.push_back(std::string());
    int sum = 0;
    for (int i = 0; i < size1; i++)
      if (chosen & (1 << i)) answer.back() += back[start[i]] + "+";
    answer.back().pop_back();
    answer.back() += "->" + back[end[index]];
    mask &= ~chosen;
    index--;
  }
  assert(mask == 0 && "You fucked up.");
  for (const std::string& luv : answer) std::cout << luv << '\n';
  return 0;
}