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

public class Main {
    private static Scanner sc;
    private static Printer pr;
    static long aLong=(long )1e9+7;
    static long ModHash=(long)1e9+9;
    static long Mod=998244353;
    private static void solve() throws IOException {
        //in the name of god
        // you are anything and we are nothing
        //God,i am so tired . I have no one but you
        int n=sc.nextInt(),m=sc.nextInt(),p=31,p1=37;
        long []pow=new long[(int)1e6+20];
        long []pow1=new long[(int)1e6+20];
        pow[0]=1;pow1[0]=1;
        TreeSet<Long>hashes=new TreeSet<>();
        TreeSet<Long>hashes1=new TreeSet<>();
        StringBuilder[]builder1=new StringBuilder[n];
        StringBuilder[]builder2=new StringBuilder[m];
        long[]hashN=new long[n];
        long[]hashM=new long[m];
        long[]hashN1=new long[n];
        long[]hashM1=new long[m];
        for (int i=0;i<n;++i){
            builder1[i] = new StringBuilder(sc.next());
        }
        for (int i=0;i<m;++i) {
            builder2[i] = new StringBuilder(sc.next());
        }
        for (int i=1;i<pow.length;++i){
            pow[i] = (pow[i-1]*p)%aLong;
            pow1[i]=(pow1[i-1]*p1)%ModHash;
        }
        for (int i=0;i<n;++i){
            long hashVal=0,hashVal1=0;
            for (int j=0;j<builder1[i].length();++j){
                hashVal=(hashVal+(builder1[i].charAt(j)-'a'+1)*pow[j])%aLong;
                hashVal1=(hashVal1+(builder1[i].charAt(j)-'a'+1)*pow1[j])%ModHash;
            }
            hashN[i]=hashVal;
            hashN1[i]=hashVal1;
        }
        for (int i=0;i<m;++i){
            long hashVal=0,hashVal1=0;
            for (int j=0;j<builder2[i].length();++j){
                hashVal=(hashVal+(builder2[i].charAt(j)-'a'+1)*pow[j])%aLong;
                hashVal1=(hashVal1+(builder2[i].charAt(j)-'a'+1)*pow1[j])%ModHash;
            }
            hashM[i]=hashVal;
            hashM1[i]=hashVal1;
        }
        for (int i=0;i<n;++i){
            for (int j=0;j<builder1[i].length();++j){
                char h=builder1[i].charAt(j);
                for (char k='a';k<'d';++k){
                    if (h==k)
                        continue;
                    if (h>k){
                        long diff=(h-'a'+1)-(k-'a'+1);
                        long newHash=((hashN[i]-((diff*pow[j])%aLong))+aLong)%aLong;
                        hashes.add(newHash);
                        hashes1.add(((hashN1[i]-((diff*pow1[j])%ModHash))+ModHash)%ModHash);
                    }
                    if (h<k){
                        long diff=(k-'a'+1)-(h-'a'+1);
                        long newHash=(hashN[i]+((diff*pow[j])%aLong))%aLong;
                        hashes.add(newHash);
                        hashes1.add((hashN1[i]+((diff*pow1[j])%ModHash))%ModHash);
                    }
                }
            }
        }
        for (int i=0;i<m;++i){
            if (hashes.contains(hashM[i])&&hashes1.contains(hashM1[i]))
                pr.println("YES");
            else
                pr.println("NO");
        }
    }
    public static int[] radixSort(int[] f) {
        int[] to = new int[f.length];
        {
            int[] b = new int[65537];
            for (int i = 0; i < f.length; i++) b[1 + (f[i] & 0xffff)]++;
            for (int i = 1; i <= 65536; i++) b[i] += b[i - 1];
            for (int i = 0; i < f.length; i++) to[b[f[i] & 0xffff]++] = f[i];
            int[] d = f;
            f = to;
            to = d;
        }
        {
            int[] b = new int[65537];
            for (int i = 0; i < f.length; i++) b[1 + (f[i] >>> 16)]++;
            for (int i = 1; i <= 65536; i++) b[i] += b[i - 1];
            for (int i = 0; i < f.length; i++) to[b[f[i] >>> 16]++] = f[i];
            int[] d = f;
            f = to;
            to = d;
        }
        return f;
    }
    public static long []primeFactor(int n){
        long []prime=new long[n+1];
        prime[1]=1;
        for (int i=2;i<=n;i++)
            prime[i]=((i&1)==0)?2:i;
        for (int i=3;i*i<=n;i++){
            if (prime[i]==i){
                for (int j=i*i;j<=n;j+=i){
                    if (prime[j]==j)
                        prime[j]=i;
                }
            }
        }
        return prime;
    }
    public static long gcd(long a,long b) {
        if (a == 0) return b;
        return gcd(b % a, a);
    }
    public static void main(String[] args) throws IOException {
        sc = new Scanner(System.in);
        pr = new Printer(System.out);
        solve();

        pr.close();
        // sc.close();
    }
    private static class Scanner {
        BufferedReader br;

        Scanner (InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
        }

        private boolean isPrintable(int ch) {
            return ch >= '!' && ch <= '~';
        }

        private boolean isCRLF(int ch) {
            return ch == '\n' || ch == '\r' || ch == -1;
        }

        private int nextPrintable() {
            try {
                int ch;
                while (!isPrintable(ch = br.read())) {
                    if (ch == -1) {
                        throw new NoSuchElementException();
                    }
                }

                return ch;
            } catch (IOException e) {
                throw new NoSuchElementException();
            }
        }

        String next() {
            try {
                int ch = nextPrintable();
                StringBuilder sb = new StringBuilder();
                do {
                    sb.appendCodePoint(ch);
                } while (isPrintable(ch = br.read()));

                return sb.toString();
            } catch (IOException e) {
                throw new NoSuchElementException();
            }
        }

        int nextInt() {
            try {
                // parseInt from Integer.parseInt()
                boolean negative = false;
                int res = 0;
                int limit = -Integer.MAX_VALUE;
                int radix = 10;

                int fc = nextPrintable();
                if (fc < '0') {
                    if (fc == '-') {
                        negative = true;
                        limit = Integer.MIN_VALUE;
                    } else if (fc != '+') {
                        throw new NumberFormatException();
                    }
                    fc = br.read();
                }
                int multmin = limit / radix;

                int ch = fc;
                do {
                    int digit = ch - '0';
                    if (digit < 0 || digit >= radix) {
                        throw new NumberFormatException();
                    }
                    if (res < multmin) {
                        throw new NumberFormatException();
                    }
                    res *= radix;
                    if (res < limit + digit) {
                        throw new NumberFormatException();
                    }
                    res -= digit;

                } while (isPrintable(ch = br.read()));

                return negative ? res : -res;
            } catch (IOException e) {
                throw new NoSuchElementException();
            }
        }

        long nextLong() {
            try {
                // parseLong from Long.parseLong()
                boolean negative = false;
                long res = 0;
                long limit = -Long.MAX_VALUE;
                int radix = 10;

                int fc = nextPrintable();
                if (fc < '0') {
                    if (fc == '-') {
                        negative = true;
                        limit = Long.MIN_VALUE;
                    } else if (fc != '+') {
                        throw new NumberFormatException();
                    }
                    fc = br.read();
                }
                long multmin = limit / radix;

                int ch = fc;
                do {
                    int digit = ch - '0';
                    if (digit < 0 || digit >= radix) {
                        throw new NumberFormatException();
                    }
                    if (res < multmin) {
                        throw new NumberFormatException();
                    }
                    res *= radix;
                    if (res < limit + digit) {
                        throw new NumberFormatException();
                    }
                    res -= digit;

                } while (isPrintable(ch = br.read()));

                return negative ? res : -res;
            } catch (IOException e) {
                throw new NoSuchElementException();
            }
        }

        float nextFloat() {
            return Float.parseFloat(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            try {
                int ch;
                while (isCRLF(ch = br.read())) {
                    if (ch == -1) {
                        throw new NoSuchElementException();
                    }
                }
                StringBuilder sb = new StringBuilder();
                do {
                    sb.appendCodePoint(ch);
                } while (!isCRLF(ch = br.read()));

                return sb.toString();
            } catch (IOException e) {
                throw new NoSuchElementException();
            }
        }

        void close() {
            try {
                br.close();
            } catch (IOException e) {
//				throw new NoSuchElementException();
            }
        }
    }
    private static class Printer extends PrintWriter {
        Printer(PrintStream out) {
            super(out);
        }
    }
}