#include<bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int st[N], ans[N];
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, q;
cin >> n >> q;
vector<int>a(n);
for(int i = 0; i < n; ++i){
cin >> a[i];
st[a[i]]++;
}
for(int i = 0; i < n; i++){
if(st[a[i]] >= 2) ans[1] = 1;
if(a[i] == 1) continue;
for(int j = 1; j * j <= a[i]; j++){
if(a[i] % j == 0 && st[j]){
ans[a[i] / j] = 1;
}
}
}
while (q--){
int x;
cin >> x;
if (ans[x]) cout << "YES\n";
else cout << "NO\n";
}
return 0;
}