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


public class NuclearFusion{
    
    static int mine[]= new int[20];
    static int his[] = new int[20];
    static int start;
    static int end;
    static int[][]wiz = new int[131972+1][20];
    static int[][]woz = new int[131972+1][20];
    static int[][]dp = new int[131972+3][20];
    static int[]waz = new int[20];

    
    static int solve(int mask , int j){
    if(dp[mask][j]!=-1)return dp[mask][j];
        if(j==end){
            
            return  1;
        }
        
        for(int i = 0 ; i < start ; i++){
            int x = 0;
            if((mask&(1<<i))==0){

            
            
             x= (mask|(1<<i));
                int sum = 0;
                    for(int k = 0 ; k < start ; k++){
                    if((x&(1<<k))!=0){
                        sum = sum+mine[k];

                    }}
            
        
            if(sum==his[j]){
                int temp = solve(x,j+1);
                if(temp == 1){
                    wiz[mask][j]=x;
                    woz[mask][j]=j+1;
                    
                    return dp[mask][j]= temp;
                }
            }else{
            int temp = solve(x,j);
            if(temp == 1){
                wiz[mask][j]=x;
                woz[mask][j]=j;
                return dp[mask][j]= temp;
            }
        }
            }
        }
        
        
        
        
        return  dp[mask][j]= 0;
        
    }
    

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

                
                
                
                for(int i = 0 ; i < start ; i++){
                    
                    if((((x)&(1<<i))&((x1)&(1<<i)))==0 && (x1&(1<<i))!=0){
                    System.out.print(counta3++==0?elements[mine[i]]:"+"+elements[mine[i]]);
                    
                    }
                }
                if(j1!=j){
                    System.out.println("->"+elements[waz[j]]);
                    counta3 = 0;
                }
                if(j1==end){
                    break;
                }
                j = j1;
                x=x1;
            }
            
            
        }else{
            System.out.println("NO");
        }
        
    }

    }
    
}
