#include <bits/stdc++.h>
using namespace std;
const long long mod = 1004006003999;
long long n, q, tmp[600005], hs, ths, bll, pw[600005];
string s;
map<long long, long long> mp;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  pw[0] = 1;
  for (long long i = 1; i <= 600000; i++) pw[i] = (pw[i - 1] * 497) % mod;
  cin >> n >> q;
  for (long long i = 1; i <= n; i++) {
    cin >> s;
    hs = 0;
    for (long long j = 1; j <= s.size(); j++)
      hs = (hs + (pw[j - 1] * s[j - 1])) % mod;
    for (long long j = 1; j <= s.size(); j++) {
      ths = (hs - pw[j - 1] * s[j - 1] + mod) % mod;
      bll = (ths + pw[j - 1] * ('a' * 1LL)) % mod;
      if (bll != hs) mp[bll] = 1;
      bll = (ths + pw[j - 1] * ('b' * 1LL)) % mod;
      if (bll != hs) mp[bll] = 1;
      bll = (ths + pw[j - 1] * ('c' * 1LL)) % mod;
      if (bll != hs) mp[bll] = 1;
    }
  }
  while (q--) {
    cin >> s;
    hs = 0;
    for (long long j = 1; j <= s.size(); j++)
      hs = (hs + (pw[j - 1] * s[j - 1])) % mod;
    if (mp[hs])
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
