from collections import defaultdict n,h=map(int,input().split()) a=list(map(int,input().split())) def prime_list(x): i=2 prime=defaultdict(int) while i*i<=x: while x%i==0: x//=i prime[i]+=1 i+=1 if x>1: prime[x]+=1 return prime p=prime_list(h) for x in a: for y in p.keys(): while p[y]>0 and x%y==0: p[y]-=1 if sum(p.values())==0: print("YES") else: print("NO")