from collections import Counter def factorize(n): a = 2 fct = [] while a * a <= n: while n % a == 0: n //= a fct.append(a) a += 1 if n > 1: fct.append(n) return fct n, h = map(int, input().split()) p = Counter(factorize(h)) a = list(map(int, input().split())) keys = list(p.keys()) for x in a: for k in keys: while p[k] > 0 and x % k == 0: p[k] -= 1 x //= k for v in p.values(): if v > 0: print('NO') break else: print('YES')