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.*;
import java.math.*;
import java.util.*;
public class Main
{
    static long modd=((long)1e9)+7;//toString
    public static int gcd(int a,int b){if(b==0)return a;else return gcd(b,a%b);}
    public static long pow_mod(long x,long y,long mod){long res=1;x=x%mod;while(y > 0){if((y & 1)==1)res=(res * x)%mod;y=y>>1;x =(x * x)%mod;}return res;}
    public static int lower_bound(int[]arr,int val){int lo=0;int hi=arr.length-1;while(lo<hi){int mid=lo+((hi-lo+1)/2);if(arr[mid]==val){return mid;}else if(arr[mid]>val){hi=mid-1;}else lo=mid;}if(arr[lo]<=val)return lo;else return -1;}
    public static int upper_bound(int[]arr,int val){int lo=0;int hi=arr.length-1;while(lo<hi){int mid=lo+((hi-lo)/2);if(arr[mid]==val){return mid;}else if(arr[mid]>val){hi=mid;;}else lo=mid+1;}if(arr[lo]>=val)return lo;else return -1;}
    public static long hasher (String st, long m){
        long ans = 0;
        long mul = 1;
        for ( int i = 0; i < st.length(); ++i){
            ans = ans + (mul *((int) (st.charAt(i) - 'a') + 1)) % m;
            mul = ((mul % m) * 5) % m;
        }
        return ans;
    }
    public static void main (String[] args) throws java.lang.Exception
    {
        Reader sn = new Reader();
        Print p = new Print();
        int n = sn.nextInt();
        int m = sn.nextInt();
        Pair[] arr = new Pair[n];
        for( int i = 0; i < n; ++i){
            String st = sn.readWord();
            arr[i] = new Pair( hasher( st , ((long)1e9 + 7)) , hasher( st , ((long) 1e9 + 9)));
        }
        Arrays.sort(arr);
        TreeSet<Pair> ts = new TreeSet<Pair>();
        for( int i = 0; i < n; ++i){
            ts.add(arr[i]);
        }
        while(m-- > 0){
            String q = sn.readWord();
            Pair pr = new Pair( hasher( q , ((long)1e9 + 7)) , hasher( q , ((long) 1e9 + 9)));
            int c=0;
            outer:for( int i = 0; i < q.length(); ++i){
                if( q.charAt(i) == 'a'){
                    Pair ar = new Pair((pr.val - pow_mod(5, i, (long)1e9+7) + (pow_mod(5, i ,(long)1e9+7)*2)%((long)1e9+7)),(pr.in - pow_mod(5, i, (long)1e9+9) + (pow_mod(5, i ,(long)1e9+9)*2)%((long)1e9+9)));
                    Pair ar2 =  new Pair((pr.val - pow_mod(5, i, (long)1e9+7) + (pow_mod(5, i ,(long)1e9+7)*3)%((long)1e9+7)),(pr.in - pow_mod(5, i, (long)1e9+9) + (pow_mod(5, i ,(long)1e9+9)*3)%((long)1e9+9)));
                    if( ts.contains(ar) ){
                        c++;
                    }
                    if( ts.contains(ar2) ){
                       c++;
                    }
    
                }
                if( q.charAt(i) == 'b'){
                    Pair br = new Pair((pr.val - ((pow_mod(5, i, (long)1e9+7)*2)%((long)1e9+7)) + (pow_mod(5, i ,(long)1e9+7)*1)%((long)1e9+7)),(pr.in - ((pow_mod(5, i, (long)1e9+9)*2)%((long)1e9+9)) + (pow_mod(5, i ,(long)1e9+9)*1)%((long)1e9+9)));
                    Pair br2 =  new Pair((pr.val - ((pow_mod(5, i, (long)1e9+7)*2)%((long)1e9+7)) + (pow_mod(5, i ,(long)1e9+7)*3)%((long)1e9+7)),(pr.in - ((pow_mod(5, i, (long)1e9+9)*2)%((long)1e9+9)) + (pow_mod(5, i ,(long)1e9+9)*3)%((long)1e9+9)));
                    if( ts.contains(br) ){
                        c++;
                    }
                    if( ts.contains(br2) ){
                        c++;
                    }
        
                }
                if( q.charAt(i) == 'c'){
                    Pair cr = new Pair((pr.val - ((pow_mod(5, i, (long)1e9+7)*3)%((long)1e9+7)) + (pow_mod(5, i ,(long)1e9+7)*1)%((long)1e9+7)),(pr.in - ((pow_mod(5, i, (long)1e9+9)*3)%((long)1e9+9)) + (pow_mod(5, i ,(long)1e9+9)*1)%((long)1e9+9)));
                    Pair cr2 =  new Pair((pr.val - ((pow_mod(5, i, (long)1e9+7)*3)%((long)1e9+7)) + (pow_mod(5, i ,(long)1e9+7)*2)%((long)1e9+7)),(pr.in - ((pow_mod(5, i, (long)1e9+9)*3)%((long)1e9+9)) + (pow_mod(5, i ,(long)1e9+9)*2)%((long)1e9+9)));
                    if( ts.contains(cr) ){
                        c++;
                    }
                    if( ts.contains(cr2) ){
                        c++;
                    }
                    
                }
            }
            if(c>0)
           { p.printLine("YES");c=0;}
            else
            p.printLine("NO");
        }
        p.close();
    }
}
class Pair implements Comparable<Pair> {
		long val;
		long in;
		Pair(long a, long b){
			val=a;
	        in=b;
		}
		public String toString(){
		    return (Long.toString(val)+" "+Long.toString(in));
		}
		@Override
		public int compareTo(Pair o) {
			if(val==o.val)
			return Long.compare(in,o.in);
			else
			return Long.compare(val,o.val);
		}}
class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;
        public boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; }
        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }
 
        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }
 
        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }
        
        public String readWord()throws IOException
        {
		int c = read();
		while (isSpaceChar(c)) c = read();        
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		}while (!isSpaceChar(c));
		return res.toString();
	    } 
	
        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');
 
            if (neg)
                return -ret;
            return ret;
        }
 
        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }
 
        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
 
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
 
            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }
 
            if (neg)
                return -ret;
            return ret;
        }
 
        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }
 
        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }
 
        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }
class Print
{
    private final BufferedWriter bw;
    public Print()
    {
        bw=new BufferedWriter(new OutputStreamWriter(System.out));
    }
    public void print(String str)throws IOException
    {
        bw.append(str);
    }
    public void printLine(String str)throws IOException
    {
        print(str);
        bw.append("\n");
    }
    public void close()throws IOException
    {
        bw.close();
    }}