Watto, the owner of a spare parts store, has recently got an order for the mechanism that can process strings in a certain way. Initially the memory of the mechanism is filled with n strings. Then the mechanism should be able to process queries of the following type: "Given string s, determine if the memory of the mechanism contains string t that consists of the same number of characters as s and differs from s in exactly one position".

Watto has already compiled the mechanism, all that's left is to write a program for it and check it on the data consisting of n initial lines and m queries. He decided to entrust this job to you.

Input

The first line contains two non-negative numbers n and m (0 ≤ n ≤ 3·105, 0 ≤ m ≤ 3·105) — the number of the initial strings and the number of queries, respectively.

Next follow n non-empty strings that are uploaded to the memory of the mechanism.

Next follow m non-empty strings that are the queries to the mechanism.

The total length of lines in the input doesn't exceed 6·105. Each line consists only of letters 'a', 'b', 'c'.

Output

For each query print on a single line "YES" (without the quotes), if the memory of the mechanism contains the required string, otherwise print "NO" (without the quotes).

Examples

Input

2 3
aaaaa
acacaca
aabaa
ccacacc
caaac


Output

YES
NO
NO


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.math.BigInteger;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader sc = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, sc, out);
        out.close();
    }

    static class Task {
    	public static final int Max=(int) (6e5+10);
    	public static final long[] Mod=new long[] {(long) (1e9+7),998244353};
    	public static final long[] Base=new long[] {11,13};
    	public static final long[][] Pow=new long[2][Max];
    	
    	public void init() {
    		Pow[0][0]=Pow[1][0]=1;
    		for(int i=1;i<Max;i++) {
    			for(int j=0;j<2;j++)
    				Pow[j][i]=Pow[j][i-1]*Base[j]%Mod[j];
    		}
    	}
    	
    	public long transe(char c) {
    		return c-'a'+1;
    	}
    	
        public void solve(int testNumber, InputReader sc, PrintWriter out) throws IOException {
        	init();
        	int n=sc.nextInt();
        	int m=sc.nextInt();
        	HashSet<Long>[] set=new HashSet[2];
        	for(int i=0;i<2;i++)
        		set[i]=new HashSet<Long>();
        	for(int i=0;i<n;i++) {
        		String temp=sc.next();
        		long[] res=new long[2];
        		for(int j=0;j<temp.length();j++) {
        			for(int k=0;k<2;k++) {
        				res[k]+=Pow[k][j]*transe(temp.charAt(j));
        				res[k]%=Mod[k];
        			}
        		}
        		set[0].add(res[0]);
        		set[1].add(res[1]);
        	}
        	long[] buf=new long[2];
        	while(m-->0) {
        		String temp=sc.next();
        		long[] res=new long[2];
        		for(int j=0;j<temp.length();j++) {
        			for(int k=0;k<2;k++) {
        				res[k]+=Pow[k][j]*transe(temp.charAt(j));
        				res[k]%=Mod[k];
        			}
        		}
        	    boolean flag=false;
        		for(int i=0;i<temp.length();i++) {
        			if(temp.charAt(i)=='a') {
        				buf[0]=res[0];
            			buf[1]=res[1];
            			buf[0]+=Pow[0][i];
            			buf[1]+=Pow[1][i];
            			buf[0]%=Mod[0];
            			buf[1]%=Mod[1];
            			if(set[0].contains(buf[0])&&set[1].contains(buf[1])) {
            				flag=true;
            				break;
            			}
            			buf[0]+=Pow[0][i];
            			buf[1]+=Pow[1][i];
            			buf[0]%=Mod[0];
            			buf[1]%=Mod[1];
            			if(set[0].contains(buf[0])&&set[1].contains(buf[1])) {
            				flag=true;
            				break;
            			}
        			}
        			if(temp.charAt(i)=='b') {
        				buf[0]=res[0];
            			buf[1]=res[1];
            			buf[0]+=Pow[0][i];
            			buf[1]+=Pow[1][i];
            			buf[0]%=Mod[0];
            			buf[1]%=Mod[1];
            			if(set[0].contains(buf[0])&&set[1].contains(buf[1])) {
            				flag=true;
            				break;
            			}
            			buf[0]=res[0];
            			buf[1]=res[1];
            			buf[0]-=Pow[0][i];
            			buf[1]-=Pow[1][i];
            			buf[0]%=Mod[0];
            			buf[1]%=Mod[1];
            			buf[0]=(buf[0]+Mod[0])%Mod[0];
            			buf[1]=(buf[1]+Mod[1])%Mod[1];
            			if(set[0].contains(buf[0])&&set[1].contains(buf[1])) {
            				flag=true;
            				break;
            			}
        			}
        			if(temp.charAt(i)=='c') {
        				buf[0]=res[0];
            			buf[1]=res[1];
            			buf[0]-=Pow[0][i];
            			buf[1]-=Pow[1][i];
            			buf[0]%=Mod[0];
            			buf[1]%=Mod[1];
            			buf[0]=(buf[0]+Mod[0])%Mod[0];
            			buf[1]=(buf[1]+Mod[1])%Mod[1];
            			if(set[0].contains(buf[0])&&set[1].contains(buf[1])) {
            				flag=true;
            				break;
            			}
            			buf[0]-=Pow[0][i];
            			buf[1]-=Pow[1][i];
            			buf[0]%=Mod[0];
            			buf[1]%=Mod[1];
            			buf[0]=(buf[0]+Mod[0])%Mod[0];
            			buf[1]=(buf[1]+Mod[1])%Mod[1];
            			if(set[0].contains(buf[0])&&set[1].contains(buf[1])) {
            				flag=true;
            				break;
            			}
        			}
        		}
        		if(flag)
        			out.println("YES");
        		else
        			out.println("NO");
        	}
        }

    }

    static  class InputReader{
        StreamTokenizer tokenizer;
        public InputReader(InputStream stream){
            tokenizer=new StreamTokenizer(new BufferedReader(new InputStreamReader(stream)));
            tokenizer.ordinaryChars(33,126);
            tokenizer.wordChars(33,126);
        }
        public String next() throws IOException {
            tokenizer.nextToken();
            return tokenizer.sval;
        }
        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }
        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }
        public boolean hasNext() throws IOException {
            int res=tokenizer.nextToken();
            tokenizer.pushBack();
            return res!=tokenizer.TT_EOF;
        }
    }
}
