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.BigInteger;

public class Main{
    final boolean isFileIO =  false;
    BufferedReader in;
    PrintWriter out;
    StringTokenizer st = new StringTokenizer("");
    String delim = " ";

    public static void main(String[] args) throws IOException {
        Main m = new Main();
        m.initIO();
        m.solve();
        m.in.close();
        m.out.close();
    }

    public void initIO() throws IOException {
        if(!isFileIO) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
    }

    String nt() throws IOException {
        if(!st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken(delim);
    }

    String rl() throws IOException {
        return in.readLine();
    }

    int ni() throws IOException {
        return Integer.parseInt(nt());
    }

    long nl() throws IOException {
        return Long.parseLong(nt());
    }

    double nd() throws IOException {
        return Double.parseDouble(nt());
    }

    class Pair {
        public int x, y;
        public Pair(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }

    public void solve() throws IOException {
        int n = ni(); int m = ni();
        String[] s = new String[n];
        String[] q = new String[m];
        int all = 0;
        for(int i = 0; i < n; i++) {
            s[i] = rl();
            all += s[i].length();
        }
        for(int i = 0; i < m; i++) {
            q[i] = rl();
        }
        int[] trieForward = new int[4 * all + 5];
        int[] trieBackward = new int[4 * all + 5];
        Arrays.fill(trieForward, -1);
        Arrays.fill(trieBackward, -1);
        HashSet<Long> set = new HashSet<Long>();
        int last = 4;
        int cur = 0;
        for(int i = 0; i < n; i++) {
            cur = 0;
            for(int j = 0; j < s[i].length(); j++) {
                int pos = s[i].charAt(j) - 'a';
                if(trieForward[cur + pos + 1] == -1) {
                    trieForward[cur + pos + 1] = last;
                    trieForward[last] = cur;
                    last += 4;
                }
                cur = trieForward[cur + pos + 1];

            }
        }
        last = 4;
        trieBackward[0] = 0;
        for(int i = 0; i < n; i++) {
            cur = 0;
            for(int j = s[i].length() - 1; j >= 0; j--) {
                int pos = s[i].charAt(j) - 'a';
                if(trieBackward[cur + pos + 1] == -1) {
                    trieBackward[cur + pos + 1] = last;
                    trieBackward[last] = cur;
                    last += 4;
                }
                cur = trieBackward[cur + pos + 1];
            }
        }
        for(int i = 0; i < n; i++) {
            int curBack = 0;
            for(int j = s[i].length() - 1; j > 0; j--) {
                int pos = s[i].charAt(j) - 'a';
                curBack = trieBackward[curBack + pos + 1];
            }
            int curFront = 0;
            long hash = 0;
            for(int j = 0; j < s[i].length(); j++) {
                int pos = s[i].charAt(j) - 'a';
                hash = (curFront) + (pos << 28) + ((long) curBack << 31);
                set.add(hash);
                curFront = trieForward[pos + curFront + 1];
                curBack = trieBackward[curBack];
            }
        }
        for(int i = 0; i < m; i++) {
            int curBack = 0;
            int lastRight = q[i].length();
            for(int j = q[i].length() - 1; j > 0; j--) {
                int pos = q[i].charAt(j)  - 'a';
                if(trieBackward[curBack + pos + 1] == -1) {
                    break;
                }
                curBack = trieBackward[curBack + pos + 1];
                lastRight = j;
            }
            int curFront = 0;
            int lastLeft = -1;
            for(int j = 0; j < lastRight - 1; j++) {
                int pos = q[i].charAt(j) - 'a';
                if(trieForward[curFront + pos + 1] == -1) {
                    break;
                }
                curFront = trieForward[curFront + pos + 1];
                lastLeft = j;
            }
            if(lastRight - lastLeft > 2) {
                out.println("NO");
                continue;
            }
            long hash = 0;
            boolean found = false;
            for(int j = lastRight - 1; j < q[i].length(); j++) {
                int pos = q[i].charAt(j) - 'a';
                for(int z = 0; z < 3; z++) {
                    if(z == pos) { continue; }
                    hash = (curFront) + (z << 28) + ((long) curBack << 31);
                    if(set.contains(hash)) {
                        found = true;
                    }
                }
                curFront = trieForward[pos + curFront + 1];
                curBack = trieBackward[curBack];
                if(curFront == -1) {
                    break;
                }
            }
            if(found) {
                out.println("YES");
            } else {
                out.println("NO");
            }

        }
    }
}

class Utils {

    public static long binpow(long a, long exp, long mod) {
        if(exp == 0) {
            return 1;
        }
        if(exp % 2 == 0) {
            long temp = binpow(a, exp / 2, mod);
            return (temp * temp) % mod;
        } else {
            return (binpow(a, exp - 1, mod) * a) % mod;
        }
    }

    public static long inv(long a, long mod) {
        return binpow(a, mod - 2, mod);
    }

    public static long addmod(long a, long b, long mod) {
        return ((a + b) % mod + mod) % mod;
    }

    public static long gcd(long a, long b) {
        if(b == 0)
            return a;
        return gcd(b, a % b);
    }

    //mul must be < 10^18
    public static long mulmod(long a, long b, long mod) {
        return (a * b + (((a * b) / mod) + 1) * mod) % mod;
    }
}