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 JAVA):

Solution:
import java.util.Arrays;
import java.util.ArrayList;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Artem Gilmudinov
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Reader in = new Reader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskE solver = new TaskE();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskE {
    int[] arr;
    public void solve(int testNumber, Reader in, PrintWriter out) {
        int n, k;
        n = in.ni(); k = in.ni();
        arr = new int[n];
        String[] elements = new String[]{"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","Md"};
        HashMap<String, Integer> name2pos = new HashMap<>();
        for(int i = 0; i < elements.length; i++) {
            name2pos.put(elements[i], i + 1);
        }

        String[] first = new String[n];
        String[] second = new String[k];
        for(int i = 0; i < n; i++) {
            first[i] = in.next();
        }
        for(int i = 0; i < k; i++) {
            second[i] = in.next();
        }
        int[] s = new int[n];
        for(int i = 0; i < n; i++) {
            s[i] = name2pos.get(first[i]);
        }
        int mask = 1 << n;
        int[] dp = new int[1 << n];
        for(int i = 0; i < mask; i++) {
            for(int j = 0; j < n; j++) {
                if((i & (1 << j)) != 0) {
                    dp[i] += s[j];
                }
            }
        }
        int[] pref = new int[1 << n];
        int[] t = new int[1 << n];
        Arrays.fill(pref, -1);
        Arrays.fill(t, -1);
        pref[0] = 0;
        ArrayList<Integer> pos = new ArrayList<>();
        int xor, next, p, tempMask, cnt, temp, z, x, b;
        for(int i = 0; i < mask; i++) {
            if(pref[i] != -1 && pref[i] != k) {
                xor = (mask - 1) ^ i;
                next = name2pos.get(second[pref[i]]);
                arr = bits(xor);
                cnt = arr.length;
                p = 1 << cnt;
                int cur = 0;
                tempMask = 0;
                int j;
                while(cur < p - 1) {
                    j = 0;
                    while((cur & (1 << j)) != 0) {
                        cur ^= (1 << j);
                        tempMask ^= arr[j];
                        ++j;
                    }
                    cur ^= (1 << j);
                    tempMask ^= arr[j];
                    temp = i | tempMask;
                    if(dp[tempMask] == next && pref[temp] <= pref[i]) {
                        pref[temp] = pref[i] + 1;
                        t[temp] = tempMask;
                    }
                }
}
        }
        int found = mask - 1;
        if(pref[found] == -1) {
            out.println("NO");
        } else {
            out.println("YES");
            while(found != 0) {
                ArrayList<String> res = new ArrayList<>();
                for(int i = 0; i < n; i++) {
                    if((t[found] & (1 << i)) != 0) {
                        res.add(first[i]);
                    }
                }
                for(int i = 0; i < res.size() - 1; i++) {
                    out.print(res.get(i) + "+");
                }
                out.println(res.get(res.size() - 1) + "->" + second[pref[found] -1]);
                found = found ^ t[found];
            }
        }
    }

    public int cntOfBits(int x) {
        int res = 0;
        while(x != 0) {
            if(x % 2 != 0) {
                ++res;
            }
            x >>= 1;
        }
        return res;
    }

    public int[] bits(int x) {
        int cnt = cntOfBits(x);
        int[] res = new int[cnt];
        for(int i = 0, j = 0; i < 17; i++) {
            if((x & (1 << i)) != 0) {
                res[j++] = (1 << i);
            }
        }
        return res;
    }

}

class Reader {
    private BufferedReader in;
    private StringTokenizer st = new StringTokenizer("");
    private String delim = " ";

    public Reader(InputStream in) {
        this.in = new BufferedReader(new InputStreamReader(in));
    }

    public String next() {
        if (!st.hasMoreTokens()) {
            st = new StringTokenizer(rl());
        }
        return st.nextToken(delim);
    }

    public String rl() {
        try {
            return in.readLine();
        } catch(IOException e) {
            throw new RuntimeException(e);
        }
    }

    public int ni() {
        return Integer.parseInt(next());
    }

}