#include <bits/stdc++.h>
using namespace std;
static const int M = 300200;
static const long long P = 1e16 + 3;
static const long long C = 203;
int main() {
  ios_base::sync_with_stdio(0);
  int n, m, l, r, curr;
  long long hsh, chsh;
  bool success;
  string b;
  vector<long long> hasharr;
  vector<long long> pow;
  vector<string> ans;
  ans.clear();
  pow.clear();
  cin >> n >> m;
  hasharr.resize(n);
  pow.push_back(1);
  for (int i = 0; i < 2 * M; i++) {
    pow.push_back(pow[i] * C % P);
  }
  for (int i = 0; i < n; i++) {
    cin >> b;
    hsh = 0;
    for (int j = 0; j < b.size(); j++) {
      hsh += pow[j] * (int)b[j];
      hsh %= P;
    }
    hasharr[i] = hsh;
  }
  sort(hasharr.begin(), hasharr.begin() + n);
  for (int i = 0; i < m; i++) {
    cin >> b;
    hsh = 0;
    for (int j = 0; j < b.size(); j++) {
      hsh += pow[j] * (int)b[j];
      hsh %= P;
    }
    success = false;
    for (int j = 0; j < b.size(); j++) {
      char ch = b[j];
      for (char k = 'a'; k != 'd'; k++) {
        if (k == ch) continue;
        chsh = hsh + pow[j] * (int)(k - ch);
        chsh = (chsh % P + P) % P;
        l = 0;
        r = n - 1;
        while (r - l > 1) {
          curr = (l + r) >> 1;
          if (hasharr[curr] > chsh) {
            r = curr;
          } else if (hasharr[curr] < chsh) {
            l = curr;
          } else {
            success = true;
            break;
          }
        }
        if (success) break;
        if (hasharr[l] == chsh) {
          success = true;
          break;
        }
        if (hasharr[r] == chsh) {
          success = true;
          break;
        }
      }
      if (success) break;
    }
    if (success)
      ans.push_back("YES");
    else
      ans.push_back("NO");
  }
  for (int i = 0; i < m; i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
