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.*;
import java.util.*;

public class E
{

    static String[] symbol=new String[]{"dummy",/*
    1",/*/"H",/*/"Hydrogen
    2",/*/"He",/*/"Helium
    3",/*/"Li",/*/"Lithium
    4",/*/"Be",/*/"Beryllium
    5",/*/"B",/*/"Boron
    6",/*/"C",/*/"Carbon
    7",/*/"N",/*/"Nitrogen
    8",/*/"O",/*/"Oxygen
    9",/*/"F",/*/"Fluorine
    10",/*/"Ne",/*/"Neon
    11",/*/"Na",/*/"Sodium
    12",/*/"Mg",/*/"Magnesium
    13",/*/"Al",/*/"Aluminum, Aluminium
    14",/*/"Si",/*/"Silicon
    15",/*/"P",/*/"Phosphorus
    16",/*/"S",/*/"Sulfur
    17",/*/"Cl",/*/"Chlorine
    18",/*/"Ar",/*/"Argon
    19",/*/"K",/*/"Potassium
    20",/*/"Ca",/*/"Calcium
    21",/*/"Sc",/*/"Scandium
    22",/*/"Ti",/*/"Titanium
    23",/*/"V",/*/"Vanadium
    24",/*/"Cr",/*/"Chromium
    25",/*/"Mn",/*/"Manganese
    26",/*/"Fe",/*/"Iron
    27",/*/"Co",/*/"Cobalt
    28",/*/"Ni",/*/"Nickel
    29",/*/"Cu",/*/"Copper
    30",/*/"Zn",/*/"Zinc
    31",/*/"Ga",/*/"Gallium
    32",/*/"Ge",/*/"Germanium
    33",/*/"As",/*/"Arsenic
    34",/*/"Se",/*/"Selenium
    35",/*/"Br",/*/"Bromine
    36",/*/"Kr",/*/"Krypton
    37",/*/"Rb",/*/"Rubidium
    38",/*/"Sr",/*/"Strontium
    39",/*/"Y",/*/"Yttrium
    40",/*/"Zr",/*/"Zirconium
    41",/*/"Nb",/*/"Niobium
    42",/*/"Mo",/*/"Molybdenum
    43",/*/"Tc",/*/"Technetium
    44",/*/"Ru",/*/"Ruthenium
    45",/*/"Rh",/*/"Rhodium
    46",/*/"Pd",/*/"Palladium
    47",/*/"Ag",/*/"Silver
    48",/*/"Cd",/*/"Cadmium
    49",/*/"In",/*/"Indium
    50",/*/"Sn",/*/"Tin
    51",/*/"Sb",/*/"Antimony
    52",/*/"Te",/*/"Tellurium
    53",/*/"I",/*/"Iodine
    54",/*/"Xe",/*/"Xenon
    55",/*/"Cs",/*/"Cesium
    56",/*/"Ba",/*/"Barium
    57",/*/"La",/*/"Lanthanum
    58",/*/"Ce",/*/"Cerium
    59",/*/"Pr",/*/"Praseodymium
    60",/*/"Nd",/*/"Neodymium
    61",/*/"Pm",/*/"Promethium
    62",/*/"Sm",/*/"Samarium
    63",/*/"Eu",/*/"Europium
    64",/*/"Gd",/*/"Gadolinium
    65",/*/"Tb",/*/"Terbium
    66",/*/"Dy",/*/"Dysprosium
    67",/*/"Ho",/*/"Holmium
    68",/*/"Er",/*/"Erbium
    69",/*/"Tm",/*/"Thulium
    70",/*/"Yb",/*/"Ytterbium
    71",/*/"Lu",/*/"Lutetium
    72",/*/"Hf",/*/"Hafnium
    73",/*/"Ta",/*/"Tantalum
    74",/*/"W",/*/"Tungsten
    75",/*/"Re",/*/"Rhenium
    76",/*/"Os",/*/"Osmium
    77",/*/"Ir",/*/"Iridium
    78",/*/"Pt",/*/"Platinum
    79",/*/"Au",/*/"Gold
    80",/*/"Hg",/*/"Mercury
    81",/*/"Tl",/*/"Thallium
    82",/*/"Pb",/*/"Lead
    83",/*/"Bi",/*/"Bismuth
    84",/*/"Po",/*/"Polonium
    85",/*/"At",/*/"Astatine
    86",/*/"Rn",/*/"Radon
    87",/*/"Fr",/*/"Francium
    88",/*/"Ra",/*/"Radium
    89",/*/"Ac",/*/"Actinium
    90",/*/"Th",/*/"Thorium
    91",/*/"Pa",/*/"Protactinium
    92",/*/"U",/*/"Uranium
    93",/*/"Np",/*/"Neptunium
    94",/*/"Pu",/*/"Plutonium
    95",/*/"Am",/*/"Americium
    96",/*/"Cm",/*/"Curium
    97",/*/"Bk",/*/"Berkelium
    98",/*/"Cf",/*/"Californium
    99",/*/"Es",/*/"Einsteinium
    100",/*/"Fm"};/*/"Fermium*/
    
    static int[] a,b;
    static int n,k;
    
    static int[] done=new int[1<<17];
    static int[] sum=new int[1<<17];
    
    static int get(String s)
    {
        for(int i=0;i<101;i++)
            if(s.equals(symbol[i]))
                return i;
        return -1;
    }
    
    static int cnt(int z)
    {
        int r=0;
        while(z>0)
        {
            r+=z&1;
            z/=2;
        }
        return r;
    }

    static boolean go(int z, int d)
    {
        done[z]=1;
        if(z==0)
        {
            System.out.println("YES");
            return true;
        }
        for(int aa=z;aa>0;aa=(aa-1)&z)
            if(sum[aa]==b[d]&&done[z^aa]==0&&go(z^aa,d+1))
            {
                int c=cnt(aa);
                for(int i=0;i<n;i++)
                    if((aa&(1<<i))!=0)
                    {
                        System.out.print(symbol[a[i]]);
                        c--;
                        if(c==0)
                            System.out.print("->");
                        else
                            System.out.print("+");
                    }
                System.out.println(symbol[b[d]]);
                return true;
            }
        return false;
    }


    public static void main(String[] args) throws Exception
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s=br.readLine();
        StringTokenizer st=new StringTokenizer(s);
        n=Integer.parseInt(st.nextToken());
        k=Integer.parseInt(st.nextToken());
        a=new int[n];
        b=new int[k];
        st=new StringTokenizer(br.readLine());
        for(int i=0;i<n;i++)
            a[i]=get(st.nextToken());
        st=new StringTokenizer(br.readLine());
        for(int i=0;i<k;i++)
            b[i]=get(st.nextToken());


        for(int i=0;i<n;i++)
            sum[1<<i]=a[i];
        for(int i=1;i<(1<<n);i++)
            sum[i]=sum[(i-1)&i]+sum[i&-i];

        boolean ok=go((1<<n)-1,0);
        if(!ok)
            System.out.println("NO");

    }
}