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.util.*;
import java.math.*;
 
public class Main {

    public class TrieNode{

        int num;
        boolean isKey;
        TrieNode[] children;

        TrieNode(int num, boolean isKey){

            this.num = num;
            this.isKey = isKey;
            this.children = new TrieNode[3];

        }

        public void add(char[] str, int idx){

            int cur = str[idx] - 'a';

            if(idx == str.length - 1){
            
                if(this.children[cur] == null){

                    TrieNode t = new TrieNode(cur, true);
                    this.children[cur] = t;

                }else{

                    this.children[cur].isKey = true;

                }
            
            }else if(this.children[cur] != null){
            
                this.children[cur].add(str, idx + 1);
            
            }else{
            
                TrieNode t = new TrieNode(cur, false);
                this.children[cur] = t;
                this.children[cur].add(str, idx + 1);
            
            }

            return;

        }

        public boolean query(char[] str, int idx, int mistakes){

            int cur = str[idx] - 'a';
            boolean res = false;

            if(idx == str.length - 1){
                
                return (this.num == cur && this.isKey && mistakes == 1) ||  // if the current equals and is a key, return true
                       (this.num != cur && this.isKey && mistakes == 0); // if current doesnt equal, and is a key and we can change one char

            }

            if(this.num == cur){ // they equal on this node

                for(int i = 0; i < 3; i++){
                    if(this.children[i] != null){
                        res |= this.children[i].query(str, idx + 1, mistakes);
                    }
                }

            }else if(this.num != cur && mistakes == 0){ // they don't equal on this node

                for(int i = 0; i < 3; i++){
                    if(this.children[i] != null){
                        res |= this.children[i].query(str, idx + 1, mistakes + 1);
                    }
                }

            }

            return res;
        }
    }



    public void solve() throws IOException{

        int n = in.nextInt();
        int m = in.nextInt();

        TrieNode root = new TrieNode('.', false);

        for(int i = 0; i < n; i++){

            char[] str = in.next().toCharArray();
            root.add(str, 0);

        }

        for(int i = 0; i < m; i++){

            char[] str = in.next().toCharArray();
            boolean res = false;

            for(int j = 0; j < 3; j++){
                if(root.children[j] != null){
                    res |= root.children[j].query(str, 0, 0);
                }
            }

            if(res){
                out.println("YES");
            }else{
                out.println("NO");
            }

        }

        return;
    }


    public BigInteger gcdBigInt(BigInteger a, BigInteger b){

        if(a.compareTo(BigInteger.valueOf(0L)) == 0){
            return b;
        }else{
            return gcdBigInt(b.mod(a), a);
        }

    }

 
    FastScanner in;
    PrintWriter out;
 
    static class FastScanner {
 
        BufferedReader br;
        StringTokenizer st;
 
        FastScanner(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
            st = null;
        }
 
        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }
 
        String nextLine() throws IOException {
            if (st == null || !st.hasMoreTokens())
                return br.readLine();
            StringBuilder result = new StringBuilder(st.nextToken());
            while (st.hasMoreTokens()) {
                result.append(" ");
                result.append(st.nextToken());
            }
            return result.toString();
        }
 
        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }
 
        long nextLong() throws IOException {
            return Long.parseLong(next());
        }
 
        double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
 
    }
 
    void run() throws IOException {
        in = new FastScanner(System.in);
        out = new PrintWriter(System.out, false);
        solve();
        out.close();
    }
 
    public static void main(String[] args) throws IOException{
        new Main().run();
    }
 
    public void printArr(int[] arr){
        for(int i = 0; i < arr.length; i++){
            out.print(arr[i] + " ");
        }
        out.println();
    }
 
    public long gcd(long a, long b){
        if(a == 0) return b;
        return gcd(b % a, a);
    }

    public boolean isPrime(long num){

        if(num == 0 || num == 1){
            return false;
        }

        for(int i = 2; i * i <= num; i++){
            if(num % i == 0){
                return false;
            }
        }

        return true;
    }

    public class Pair<A, B>{
        public A x; 
        public B y;

        Pair(A x, B y){
            this.x = x;
            this.y = y;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Pair<?, ?> pair = (Pair<?, ?>) o;
            if (!x.equals(pair.x)) return false;
            return y.equals(pair.y);
        }

        @Override
        public int hashCode() {
            int result = x.hashCode();
            result = 31 * result + y.hashCode();
            return result;
        }

    }

    class Tuple{
        int x; int y; int z;
        Tuple(int ix, int iy, int iz){
            x = ix;
            y = iy;
            z = iz;
        }
    }
}
