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.BufferedWriter;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.math.BigInteger;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.IOException;
import java.util.Arrays;
import java.io.InputStream;
import java.util.Random;
import java.util.Collection;
import java.io.OutputStreamWriter;

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

 class TaskC {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int n = in.readInt();
        int m = in.readInt();
        long mod1 = BigInteger.valueOf((long) 1e9 + 1111111).nextProbablePrime().longValue();
        long mod2 = BigInteger.valueOf((long) 1e9 + 2222222).nextProbablePrime().longValue();
        long prime1 = BigInteger.valueOf(1111).nextProbablePrime().longValue();
        long prime2 = BigInteger.valueOf(2222).nextProbablePrime().longValue();
        long[] pow1 = new long[600001];
        long[] pow2 = new long[600001];
        pow1[0] = pow2[0] = 1;
        for (int i = 1; i < pow1.length; i++) {
            pow1[i] = pow1[i - 1] * prime1 % mod1;
            pow2[i] = pow2[i - 1] * prime2 % mod2;
        }
        EzLongHashSet set = new EzLongHashSet();
        for (int i = 0; i < n; i++) {
            String s = in.readString();
            long hash1 = 0, hash2 = 0;
            for (int j = 0; j < s.length(); j++) {
                hash1 = (hash1 + pow1[j] * s.charAt(j)) % mod1;
                hash2 = (hash2 + pow2[j] * s.charAt(j)) % mod2;
            }
            for (int j = 0; j < s.length(); j++) {
                for (char c = 'a'; c <= 'c'; c++) {
                    if (s.charAt(j) != c) {
                        long new1 = (hash1 - pow1[j] * s.charAt(j) + pow1[j] * c) % mod1;
                        long new2 = (hash2 - pow2[j] * s.charAt(j) + pow2[j] * c) % mod2;
                        if (new1 < 0) new1 += mod1;
                        if (new2 < 0) new2 += mod2;
                        set.add(compress((int) new1, (int) new2));
                    }
                }
            }
        }
        for (int i = 0; i < m; i++) {
            String s = in.readString();
            long hash1 = 0, hash2 = 0;
            for (int j = 0; j < s.length(); j++) {
                hash1 = (hash1 + pow1[j] * s.charAt(j)) % mod1;
                hash2 = (hash2 + pow2[j] * s.charAt(j)) % mod2;
            }
            long toFind = compress((int) hash1, (int) hash2);
            if (set.contains(toFind)) {
                out.printLine("YES");
            } else {
                out.printLine("NO");
            }
        }
    }

    private long compress(int a, int b) {
        return ((long)a << 32) | b;
    }
}


 class InputReader {

     private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

     public int readInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

     public String readString() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			if (Character.isValidCodePoint(c))
				res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return isWhitespace(c);
	}

	public static boolean isWhitespace(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

     public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}


 class OutputWriter {
	private final PrintWriter writer;

	public OutputWriter(OutputStream outputStream) {
		writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	}

	public OutputWriter(Writer writer) {
		this.writer = new PrintWriter(writer);
	}

     public void print(Object...objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}

     public void printLine(Object...objects) {
		print(objects);
		writer.println();
	}

     public void close() {
		writer.close();
	}

 }

 class EzLongHashSet implements EzLongSet {
    private static final int DEFAULT_CAPACITY = 8;

     private static final int HASHCODE_INITIAL_VALUE = 0x811c9dc5;
    private static final int HASHCODE_MULTIPLIER = 0x01000193;

    private static final byte FREE = 0;
     private static final byte FILLED = 2;

    private static final Random rnd = new Random();
    private static final int POS_RANDOM_SHIFT_1;
    private static final int POS_RANDOM_SHIFT_2;
    private static final int STEP_RANDOM_SHIFT_1;
    private static final int STEP_RANDOM_SHIFT_2;

    static {
        POS_RANDOM_SHIFT_1 = rnd.nextInt(10) + 11;
        POS_RANDOM_SHIFT_2 = rnd.nextInt(10) + 21;
        STEP_RANDOM_SHIFT_1 = rnd.nextInt(10) + 11;
        STEP_RANDOM_SHIFT_2 = rnd.nextInt(10) + 21;
    }

    private long[] table;
    private byte[] status;
    private int size;
    private int removedCount;
    private int mask;
    private final int hashSeed;

    public EzLongHashSet() {
        this(DEFAULT_CAPACITY);
    }

    public EzLongHashSet(int capacity) {
        if (capacity < 0) {
            throw new IllegalArgumentException("Capacity must be non-negative");
        }
        int length = 4 * Math.max(1, capacity);
        if ((length & (length - 1)) != 0) {
            length = Integer.highestOneBit(length) << 1;
        }
        initEmptyTable(length);
        hashSeed = rnd.nextInt();
    }

    public EzLongHashSet(EzLongCollection collection) {
        this(collection.size());
        for (EzLongIterator iterator = collection.iterator(); iterator.hasNext(); ) {
            add(iterator.next());
        }
    }

    public EzLongHashSet(long[] srcArray) {
        this(srcArray.length);
        for (long element : srcArray) {
            add(element);
        }
    }

    public EzLongHashSet(Collection<Long> javaCollection) {
        this(javaCollection.size());
        for (long element : javaCollection) {
            add(element);
        }
    }

    private int getStartPos(int h) {
        h ^= hashSeed;
        h ^= (h >>> POS_RANDOM_SHIFT_1) ^ (h >>> POS_RANDOM_SHIFT_2);
        return h & mask;
    }

    private int getStep(int h) {
        h ^= hashSeed;
        h ^= (h >>> STEP_RANDOM_SHIFT_1) ^ (h >>> STEP_RANDOM_SHIFT_2);
        return ((h << 1) | 1) & mask;
    }

    public int size() {
        return size;
    }

     public boolean contains(long element) {
        final int elementHash = PrimitiveHashCalculator.getHash(element);
        int pos = getStartPos(elementHash);
        final int step = getStep(elementHash);
        for (; status[pos] != FREE; pos = (pos + step) & mask) {
            if (status[pos] == FILLED && table[pos] == element) {
                return true;
            }
        }
        return false;
    }

    public EzLongIterator iterator() {
        return new EzLongHashSetIterator();
    }

    public long[] toArray() {
        long[] result = new long[size];
        for (int i = 0, j = 0; i < table.length; i++) {
            if (status[i] == FILLED) {
                result[j++] = table[i];
            }
        }
        return result;
    }

    public boolean add(long element) {
        final int elementHash = PrimitiveHashCalculator.getHash(element);
        int pos = getStartPos(elementHash);
        final int step = getStep(elementHash);
        for (; status[pos] == FILLED; pos = (pos + step) & mask) {
            if (table[pos] == element) {
                return false;
            }
        }
        if (status[pos] == FREE) {
            status[pos] = FILLED;
            table[pos] = element;
            size++;
            if ((size + removedCount) * 2 > table.length) {
                rebuild(table.length * 2);
            }
            return true;
        }
        final int removedPos = pos;
        for (pos = (pos + step) & mask; status[pos] != FREE; pos = (pos + step) & mask) {
            if (status[pos] == FILLED && table[pos] == element) {
                return false;
            }
        }
        status[removedPos] = FILLED;
        table[removedPos] = element;
        size++;
        removedCount--;
        return true;
    }

     private void rebuild(int newLength) {
        long[] oldTable = table;
        byte[] oldStatus = status;
        initEmptyTable(newLength);
        for (int i = 0; i < oldTable.length; i++) {
            if (oldStatus[i] == FILLED) {
                add(oldTable[i]);
            }
        }
    }

    private void initEmptyTable(int length) {
        table = new long[length];
        status = new byte[length];
        size = 0;
        removedCount = 0;
        mask = length - 1;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        EzLongHashSet that = (EzLongHashSet) o;

        if (size != that.size) {
            return false;
        }
        for (int i = 0; i < table.length; i++) {
            if (status[i] == FILLED) {
                if (!that.contains(table[i])) {
                    return false;
                }
            }
        }
        return true;
    }

    public int hashCode() {
        long[] array = toArray();
        EzLongSort.sort(array);
        int hash = HASHCODE_INITIAL_VALUE;
        for (int i = 0; i < size; i++) {
            hash = (hash ^ PrimitiveHashCalculator.getHash(array[i])) * HASHCODE_MULTIPLIER;
        }
        return hash;
    }

    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append('[');
        for (int i = 0; i < table.length; i++) {
            if (status[i] == FILLED) {
                if (sb.length() > 1) {
                    sb.append(", ");
                }
                sb.append(table[i]);
            }
        }
        sb.append(']');
        return sb.toString();
    }

    private class EzLongHashSetIterator implements EzLongIterator {
        private int curIndex = 0;

        public boolean hasNext() {
            while (curIndex < table.length && status[curIndex] != FILLED) {
                curIndex++;
            }
            return curIndex < table.length;
        }

        public long next() {
            while (curIndex < table.length && status[curIndex] != FILLED) {
                curIndex++;
            }
            if (curIndex == table.length) {
                throw new NoSuchElementException("Iterator doesn't have more elements");
            }
            return table[curIndex++];
        }
    }
}


interface EzLongSet extends EzLongCollection {
    int size();

     EzLongIterator iterator();

     boolean equals(Object object);

    int hashCode();

    String toString();
}


interface EzLongCollection {
    int size();

    EzLongIterator iterator();

    boolean equals(Object object);

    int hashCode();

    String toString();
}


 interface EzLongIterator {
    boolean hasNext();

    long next();
}

 final class PrimitiveHashCalculator {
    private PrimitiveHashCalculator() {
    }

     public static int getHash(long x) {
        return (int)x ^ (int)(x >>> 32);
    }

 }


 final class EzLongSort {
    private static final double HEAPSORT_DEPTH_COEFFICIENT = 2.0;

    private static final Random rnd = new Random();

    private EzLongSort() {
    }

    private static int maxQuickSortDepth(int length) {
        if (length <= 1) {
            return 0;
        }
        int log = Integer.numberOfTrailingZeros(Integer.highestOneBit(length - 1)) + 1;
        return (int) (HEAPSORT_DEPTH_COEFFICIENT * log);
    }

     public static void sort(long[] a) {
        quickSort(a, 0, a.length, 0, maxQuickSortDepth(a.length));
    }

     private static void quickSort(long[] a, int left, int right, int depth, int maxDepth) {
        if (right - left <= 1) {
            return;
        }
        if (depth > maxDepth) {
            heapSort(a, left, right - left);
            return;
        }
        final long pivot = a[left + rnd.nextInt(right - left)];
        int i = left;
        int j = right - 1;
        do {
            while (a[i] < pivot) i++;
            while (pivot < a[j]) j--;
            if (i <= j) {
                long tmp = a[i];
                a[i++] = a[j];
                a[j--] = tmp;
            }
        } while (i <= j);
        quickSort(a, left, j + 1, depth + 1, maxDepth);
        quickSort(a, i, right, depth + 1, maxDepth);
    }

    private static void heapSort(long[] a, int offset, int size) {
        for (int i = (size >>> 1) - 1; i >= 0; i--) {
            down(a, i, offset, size);
        }
        for (int i = size - 1; i > 0; i--) {
            long tmp = a[offset];
            a[offset] = a[offset + i];
            a[offset + i] = tmp;
            down(a, 0, offset, i);
        }
    }

    private static void down(long[] a, int index, int offset, int size) {
        final long element = a[offset + index];
        final int firstLeaf = (size >>> 1);
        while (index < firstLeaf) {
            int largestChild = (index << 1) + 1;
            if (largestChild + 1 < size && a[offset + largestChild + 1] > a[offset + largestChild]) {
                largestChild++;
            }
            if (a[offset + largestChild] <= element) {
                break;
            }
            a[offset + index] = a[offset + largestChild];
            index = largestChild;
        }
        a[offset + index] = element;
    }
}


