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.*;
import java.io.*;
import static java.lang.Math.*;

public class Main implements Runnable {
	private void solution() throws IOException {
		Map<String, Integer> map = new HashMap<String, Integer>();
		map.put("H", 1);
		map.put("He", 2);
		map.put("Li", 3);
		map.put("Be", 4);
		map.put("B", 5);
		map.put("C", 6);
		map.put("N", 7);
		map.put("O", 8);
		map.put("F", 9);
		map.put("Ne", 10);
		map.put("Na", 11);
		map.put("Mg", 12);
		map.put("Al", 13);
		map.put("Si", 14);
		map.put("P", 15);
		map.put("S", 16);
		map.put("Cl", 17);
		map.put("Ar", 18);
		map.put("K", 19);
		map.put("Ca", 20);
		map.put("Sc", 21);
		map.put("Ti", 22);
		map.put("V", 23);
		map.put("Cr", 24);
		map.put("Mn", 25);
		map.put("Fe", 26);
		map.put("Co", 27);
		map.put("Ni", 28);
		map.put("Cu", 29);
		map.put("Zn", 30);
		map.put("Ga", 31);
		map.put("Ge", 32);
		map.put("As", 33);
		map.put("Se", 34);
		map.put("Br", 35);
		map.put("Kr", 36);
		map.put("Rb", 37);
		map.put("Sr", 38);
		map.put("Y", 39);
		map.put("Zr", 40);
		map.put("Nb", 41);
		map.put("Mo", 42);
		map.put("Tc", 43);
		map.put("Ru", 44);
		map.put("Rh", 45);
		map.put("Pd", 46);
		map.put("Ag", 47);
		map.put("Cd", 48);
		map.put("In", 49);
		map.put("Sn", 50);
		map.put("Sb", 51);
		map.put("Te", 52);
		map.put("I", 53);
		map.put("Xe", 54);
		map.put("Cs", 55);
		map.put("Ba", 56);
		map.put("La", 57);
		map.put("Ce", 58);
		map.put("Pr", 59);
		map.put("Nd", 60);
		map.put("Pm", 61);
		map.put("Sm", 62);
		map.put("Eu", 63);
		map.put("Gd", 64);
		map.put("Tb", 65);
		map.put("Dy", 66);
		map.put("Ho", 67);
		map.put("Er", 68);
		map.put("Tm", 69);
		map.put("Yb", 70);
		map.put("Lu", 71);
		map.put("Hf", 72);
		map.put("Ta", 73);
		map.put("W", 74);
		map.put("Re", 75);
		map.put("Os", 76);
		map.put("Ir", 77);
		map.put("Pt", 78);
		map.put("Au", 79);
		map.put("Hg", 80);
		map.put("Tl", 81);
		map.put("Pb", 82);
		map.put("Bi", 83);
		map.put("Po", 84);
		map.put("At", 85);
		map.put("Rn", 86);
		map.put("Fr", 87);
		map.put("Ra", 88);
		map.put("Ac", 89);
		map.put("Th", 90);
		map.put("Pa", 91);
		map.put("U", 92);
		map.put("Np", 93);
		map.put("Pu", 94);
		map.put("Am", 95);
		map.put("Cm", 96);
		map.put("Bk", 97);
		map.put("Cf", 98);
		map.put("Es", 99);
		map.put("Fm", 100);
		map.put("Md", 101);
		map.put("No", 102);
		map.put("Lr", 103);
		map.put("Rf", 104);
		map.put("Db", 105);
		map.put("Sg", 106);
		map.put("Bh", 107);
		map.put("Hs", 108);
		map.put("Mt", 109);
		map.put("Ds", 110);
		map.put("Rg", 111);
		map.put("Cn", 112);
		map.put("Uut", 113);
		map.put("Uuq", 114);
		map.put("Uup", 115);
		map.put("Uuh", 116);
		map.put("Uus", 117);
		map.put("Uuo", 118);
		int n = in.nextInt();
		int k = in.nextInt();
		String[] haveString = in.nextStrings(n);
		String[] needString = in.nextStrings(k);
		int[] have = new int[n];
		int[] need = new int[k];
		for (int i = 0; i < n; ++i) {
			have[i] = map.get(haveString[i]);
		}
		for (int i = 0; i < k; ++i) {
			need[i] = map.get(needString[i]);
		}
		int[] dp = new int[1 << n];
		Arrays.fill(dp, -1);
		dp[0] = 0;
		int[] sum = new int[1 << n];
		for (int set = 0; set < (1 << n); ++set) {
			for (int i = 0; i < n; ++i) {
				if (((set >> i) & 1) != 0) {
					sum[set] += have[i];
				}
			}
		}
		int[] high = new int[1 << n];
		Arrays.fill(high, -1);
		for (int set = 1; set < (1 << n); ++set) {
			int cur = 0;
			for (int i = 0; i < k; ++i) {
				cur += need[i];
				if (cur >= sum[set]) {
					if (cur == sum[set]) {
						high[set] = i;
					}
					break;
				}
			}
		}
		for (int set = 1; set < (1 << n); ++set) {
			if (high[set] != -1) {
				int nd = need[high[set]];
				for (int nset = set; nset > 0; nset = (nset - 1) & set) {
					if (sum[nset] == nd && dp[set ^ nset] != -1) {
						dp[set] = nset;
						break;
					}
				}
			}
		}
		if (dp[(1 << n) - 1] == -1) {
			out.println("NO");
		} else {
			out.println("YES");
			List<Integer> sets = new ArrayList<Integer>();
			int curSet = (1 << n) - 1;
			while (curSet != 0) {
				sets.add(dp[curSet]);
				curSet ^= dp[curSet];
			}
			Collections.reverse(sets);
			for (int i = 0; i < sets.size(); ++i) {
				List<String> tokens = new ArrayList<String>();
				for (int j = 0; j < n; ++j) {
					if (((sets.get(i) >> j) & 1) != 0) {
						tokens.add(haveString[j]);
					}
				}
				for (int j = 0; j < tokens.size(); ++j) {
					if (j != 0) {
						out.print("+");
					}
					out.print(tokens.get(j));
				}
				out.println("->" + needString[i]);
			}
		}
	}

	public void run() {
		try {
			// try {
			// String fileName = "";
			// in = new Scanner(new FileReader(fileName + ".in"));
			// out = new PrintWriter(fileName + ".out");
			// } catch (Exception e) {
			// }
			solution();
			System.err.flush();
			in.reader.close();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	private static class Scanner {
		private BufferedReader reader;
		private StringTokenizer tokenizer;

		public Scanner(Reader reader) {
			this.reader = new BufferedReader(reader);
			this.tokenizer = new StringTokenizer("");
		}

		public boolean hasNext() throws IOException {
			while (!tokenizer.hasMoreTokens()) {
				String line = reader.readLine();
				if (line == null) {
					return false;
				}
				tokenizer = new StringTokenizer(line);
			}
			return true;
		}

		public String next() throws IOException {
			hasNext();
			return tokenizer.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		private long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			tokenizer = new StringTokenizer("");
			return reader.readLine();
		}

		public int[] nextInts(int n) throws IOException {
			int[] res = new int[n];
			for (int i = 0; i < n; ++i) {
				res[i] = nextInt();
			}
			return res;
		}

		public long[] nextLongs(int n) throws IOException {
			long[] res = new long[n];
			for (int i = 0; i < n; ++i) {
				res[i] = nextLong();
			}
			return res;
		}

		public double[] nextDoubles(int n) throws IOException {
			double[] res = new double[n];
			for (int i = 0; i < n; ++i) {
				res[i] = nextDouble();
			}
			return res;
		}

		public String[] nextStrings(int n) throws IOException {
			String[] res = new String[n];
			for (int i = 0; i < n; ++i) {
				res[i] = next();
			}
			return res;
		}
	}

	public static void main(String[] args) {
		new Thread(null, new Main(), "Main", 1 << 28).start();
	}
	private Scanner in = new Scanner(new InputStreamReader(System.in));
	private PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
}