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.*;

public class Main {
    static int n, k;
    static int[] a;
    static int[] b;
    static int[] res;
    static String[] ret;
    static Map<String, Integer> mp;
    static String[] hash;
    static int[] sum;
    static boolean[][] vst;
    
    static boolean dfs(int d, int mask) {
//      System.out.println(d+" "+mask);
        if(d==k){
            if(mask==0){
                return true;
            }else{
                return false;
            }
        }
        if(vst[d][mask]) return false;
        vst[d][mask]=true;
        for(int i=mask;i!=0;i=(i-1)&mask){
//          System.out.println("Check "+i+" "+sum[i]+" "+b[d]);
            if(sum[i]==b[d]){
                res[d]=i;
                if(dfs(d+1,mask^i)){
                    return true;
                }
            }
        }
        
        return false;
    }

    public static void main(final String[] args) {
        final Scanner cin = new Scanner(System.in);
        boolean ok;
        int val = 0;
        String s;

        init();
        n = cin.nextInt();
        k = cin.nextInt();
        a = new int[n];
        b = new int[k];
        res = new int[k];
        ret = new String[k];
        sum = new int[1 << n];
        vst = new boolean[k][1 << n];
        for (int i = 0; i < n; i++) {
            s = cin.next();
            a[i] = get(s);
            val += a[i];
        }
        for (int i = 0; i < k; i++) {
            s = cin.next();
            b[i] = get(s);
            val -= b[i];
        }
        if (val != 0) {
            System.out.println("NO");
            return;
        }
        val = 1 << n;
        sum[0] = 0;
        for(int i=0;i<k;i++){
            vst[i][0]=false;
        }
//      System.out.print("0");
        for (int i = 1; i < val; i++) {
            int t = i & -i;
            sum[i] = sum[i ^ t] + a[F(t)];
//          System.out.print(" "+sum[i]);
            for(int j=0;j<k;j++){
                vst[j][i]=false;
            }
        }
//      System.out.println();
        Arrays.fill(res, 0);
        if (dfs(0, (1 << n) - 1)) {
            ok = true;
            for (int i = 0; i < k; i++) {
                show(i);
            }
        } else {
            ok = false;
        }
        if (ok) {
            System.out.println("YES");
            for (int i = 0; i < k; i++) {
                System.out.println(ret[i]);
            }
        } else {
            System.out.println("NO");
        }
    }

    private static int F(int t) {
        int ret = 0;
        while ((t & (1 << ret)) == 0) {
            ret++;
        }
        return ret;
    }

    static void init() {
        mp = new TreeMap<String, Integer>();
        hash = new String[101];
        mp.put("H", 1);
        mp.put("He", 2);
        mp.put("Li", 3);
        mp.put("Be", 4);
        mp.put("B", 5);
        mp.put("C", 6);
        mp.put("N", 7);
        mp.put("O", 8);
        mp.put("F", 9);
        mp.put("Ne", 10);
        mp.put("Na", 11);
        mp.put("Mg", 12);
        mp.put("Al", 13);
        mp.put("Si", 14);
        mp.put("P", 15);
        mp.put("S", 16);
        mp.put("Cl", 17);
        mp.put("Ar", 18);
        mp.put("K", 19);
        mp.put("Ca", 20);
        mp.put("Sc", 21);
        mp.put("Ti", 22);
        mp.put("V", 23);
        mp.put("Cr", 24);
        mp.put("Mn", 25);
        mp.put("Fe", 26);
        mp.put("Co", 27);
        mp.put("Ni", 28);
        mp.put("Cu", 29);
        mp.put("Zn", 30);
        mp.put("Ga", 31);
        mp.put("Ge", 32);
        mp.put("As", 33);
        mp.put("Se", 34);
        mp.put("Br", 35);
        mp.put("Kr", 36);
        mp.put("Rb", 37);
        mp.put("Sr", 38);
        mp.put("Y", 39);
        mp.put("Zr", 40);
        mp.put("Nb", 41);
        mp.put("Mo", 42);
        mp.put("Tc", 43);
        mp.put("Ru", 44);
        mp.put("Rh", 45);
        mp.put("Pd", 46);
        mp.put("Ag", 47);
        mp.put("Cd", 48);
        mp.put("In", 49);
        mp.put("Sn", 50);
        mp.put("Sb", 51);
        mp.put("Te", 52);
        mp.put("I", 53);
        mp.put("Xe", 54);
        mp.put("Cs", 55);
        mp.put("Ba", 56);
        mp.put("La", 57);
        mp.put("Ce", 58);
        mp.put("Pr", 59);
        mp.put("Nd", 60);
        mp.put("Pm", 61);
        mp.put("Sm", 62);
        mp.put("Eu", 63);
        mp.put("Gd", 64);
        mp.put("Tb", 65);
        mp.put("Dy", 66);
        mp.put("Ho", 67);
        mp.put("Er", 68);
        mp.put("Tm", 69);
        mp.put("Yb", 70);
        mp.put("Lu", 71);
        mp.put("Hf", 72);
        mp.put("Ta", 73);
        mp.put("W", 74);
        mp.put("Re", 75);
        mp.put("Os", 76);
        mp.put("Ir", 77);
        mp.put("Pt", 78);
        mp.put("Au", 79);
        mp.put("Hg", 80);
        mp.put("Tl", 81);
        mp.put("Pb", 82);
        mp.put("Bi", 83);
        mp.put("Po", 84);
        mp.put("At", 85);
        mp.put("Rn", 86);
        mp.put("Fr", 87);
        mp.put("Ra", 88);
        mp.put("Ac", 89);
        mp.put("Th", 90);
        mp.put("Pa", 91);
        mp.put("U", 92);
        mp.put("Np", 93);
        mp.put("Pu", 94);
        mp.put("Am", 95);
        mp.put("Cm", 96);
        mp.put("Bk", 97);
        mp.put("Cf", 98);
        mp.put("Es", 99);
        mp.put("Fm", 100);
        final Set<Map.Entry<String, Integer>> st = mp.entrySet();
        final Iterator<Map.Entry<String, Integer>> it = st.iterator();
        while (it.hasNext()) {
            final Map.Entry<String, Integer> sub = it.next();
            hash[sub.getValue()] = sub.getKey();
        }
    }

    static int get(final String s) {
        return mp.get(s);
    }

    static String get(final int n) {
        return hash[n];
    }

    static void show(final int id) {
        boolean done = false;
        ret[id] = new String();
        for (int i = 0; i < n; i++) {
            if ((res[id] & (1 << i)) != 0) {
                if (done)
                    ret[id] += "+";
                else
                    done = true;
                ret[id] += get(a[i]);
            }
        }
        ret[id] += "->";
        ret[id] += get(b[id]);
    }
}