import collections def ps(n): ret=collections.defaultdict(int) for i in range(2,int(n**0.5)+1): while n%i==0: ret[i]+=1 n//=i if n!=1: ret[n]+=1 return ret n,h=map(int,input().split()) arr=list(map(int,input().split())) primes=ps(h) for val in arr: for p in primes.keys(): if primes[p]==0: continue while val%p==0: primes[p]-=1 val//=p if primes[p]==0: break for p in primes.keys(): if primes[p]!=0: print('NO') break else: print('YES')