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.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.StringTokenizer;


public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		HashMap<String, Integer> mp = new HashMap<String, Integer>();
		
        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);

        InputReader r = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
		
		int N = r.nextInt();
		int K = r.nextInt();
		
		String[] a = new String[N];
		for(int i = 0; i < N; i++)
			a[i] = r.next();
		
		String[] b = new String[K];
		for(int i = 0; i < K; i++)
			b[i] = r.next();
		
		int[] av = new int[N];
		for(int i = 0; i < N; i++)
			av[i] = mp.get(a[i]);
		int[] bv = new int[K];
		for(int i = 0; i < K; i++)
			bv[i] = mp.get(b[i]);
		
//		ArrayList<Integer>[] sums = new ArrayList[2000];
//		for(int i = 0; i < 2000; i++)
//			sums[i] = new ArrayList<Integer>();
		
		int[] sum = new int[1 << N];
		int[] DP = new int[1 << N];
		
		Arrays.fill(DP, -1);
		
		for(int m = 0; m < 1 << N; m++){
			int s = 0;
			for(int i = 0; i < N; i++)if((m & (1 << i)) != 0)
				s += mp.get(a[i]);
			sum[m] = s;
		}
		
		
//		for(int i = K - 1; i >= 0; i--)
			for(int m = (1 << N) - 1; m >= 0; m--){
				int i = -1;
				int ps = 0;
				if(m == 0)i = 0;
				for(int j = 0; j < K; j++){
					ps += bv[j];
					if(ps == sum[m])i = j + 1;
				}
				
				if(i == -1)continue;
				if(i == K){
					DP[m] = 0;
					continue;
				}
				
				int rem = ~m & ((1 << N) - 1);
				for(int t = rem; t > 0; t = (t - 1) & rem)if(sum[t] == bv[i]){
					if(DP[m | t] != -1){
						DP[m] = t;
						break;
					}
				}
			}
			
		if(DP[0] == -1){
			out.println("NO");
			out.close();
			return;
		}
		
		out.println("YES");
		int idx = 0;
		int curr = 0;
		
		while(idx < K){
			int t = DP[curr];
			
			boolean first = true;
			for(int i = 0; i < N; i++)if((t & (1 << i)) != 0){
				if(!first)out.print("+");
				first = false;
				out.print(a[i]);
			}
			out.println("->" + b[idx]);
			
			curr |= t;
			idx++;
		}
		
		out.close();
	}
	
	static class InputReader {
	    private BufferedReader reader;
	    private StringTokenizer tokenizer;

	    public InputReader(InputStream stream) {
	        reader = new BufferedReader(new InputStreamReader(stream));
	        tokenizer = null;
	    }

	    public String nextLine(){
	    	try {
				return reader.readLine();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return null;
			}
	    }
	    public String next() {
	        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	                tokenizer = new StringTokenizer(reader.readLine());
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }
	        return tokenizer.nextToken();
	    }

	    public int nextInt() {
	        return Integer.parseInt(next());
	    }
	    public long nextLong() {
	        return Long.parseLong(next());
	    }
	}
}