n,Q = map(int,input().split())
lst = map(int,input().split())
lst = sorted(lst)
mapp = [0 for i in range(200001)]
map_ = [False for _ in range(200001)]
if len(lst) != len(set(lst)):
mapp[1] = 1
lst = list(set(lst))
for i in lst:
map_[i] = True
for k in lst:
for m in range(1,int(math.sqrt(k))+1):
if k % m == 0:
s = k//m
if map_[s] == True or map_[m] == True:
mapp[k] = 1
break
z = []
for i in range(Q):
r = int(input())
if mapp[r] == 1:
z.append("YES")
else:
z.append("NO")
for i in z:
print(i)