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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.util.Set;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.HashSet;
import java.util.Map;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rustam Musin (t.me/musin_acm)
 */
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);
    CUottoIMekhanizm solver = new CUottoIMekhanizm();
    solver.solve(1, in, out);
    out.close();
  }

  static class CUottoIMekhanizm {
    public void solve(int testNumber, InputReader in, OutputWriter out) {

      int n = in.readInt();
      int m = in.readInt();
      String[] a = in.readStringArray(n);
      String[] b = in.readStringArray(m);
      boolean[] ans = new boolean[m];
      Arrays.fill(ans, true);
      long[] pow = new long[(int) 6e5];
      for (int mod : new int[]{(int) 1e9 + 7, (int) 1e9 + 9, 998244353}) {
        pow[0] = 1;
        for (int i = 1; i < pow.length; i++) pow[i] = (pow[i - 1] * 3) % mod;
        Map<Integer, Set<Long>> lenToHashes = new HashMap<>();
        for (String s : a) {
          long hash = 0;
          for (int j = 0; j < s.length(); j++) hash = (hash + pow[j] * (s.charAt(j) - 'a')) % mod;
          lenToHashes.computeIfAbsent(s.length(), k -> new HashSet<>()).add(hash);
        }
        for (int i = 0; i < b.length; i++) {
          if (!ans[i]) continue;
          char[] s = b[i].toCharArray();
          Set<Long> hashes = lenToHashes.getOrDefault(s.length, Collections.emptySet());
          long hash = 0;
          for (int j = 0; j < s.length; j++) hash = (hash + pow[j] * (s[j] - 'a')) % mod;
          boolean any = false;
          for (int j = 0; j < s.length && !any; j++) {
            long hash1 = (hash - pow[j] * (s[j] - 'a') % mod + mod) % mod;
            for (int k = 0; k < 3; k++) {
              if (s[j] - 'a' != k) {
                long hash2 = (hash1 + k * pow[j]) % mod;
                if (hashes.contains(hash2)) {
                  any = true;
                  break;
                }
              }
            }
          }
          ans[i] &= any;
        }
      }
      for (boolean res : ans) out.printLine(res ? "YES" : "NO");
    }

  }

  static class InputReader {
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private InputReader.SpaceCharFilter filter;

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

    public String[] readStringArray(int size) {
      String[] array = new String[size];
      for (int i = 0; i < size; i++) {
        array[i] = readString();
      }
      return array;
    }

    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);

    }

  }

  static 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();
    }

  }
}

