from collections import Counter from functools import reduce from operator import add import math def make_primes(size: int) -> list: if not isinstance(size, int): raise AttributeError("args must be int but given %s" % size.__class__) if size < 0: raise ValueError("args must be (size < 0) but given %s" % size) if size < 2: return [] res = [] flag = [True for _ in range(size + 1)] limit = int(math.sqrt(size)) for i in range(2, limit + 1): if flag[i]: res.append(i) for j in range(i, size + 1, i): flag[j] = False for i in range(max(2, limit), size + 1): if flag[i]: res.append(i) return res def prime_factor(n: int, primes: list) -> Counter: if not isinstance(n, int) or not isinstance(primes, list): raise AttributeError("args must be int but given (%s, %s)" % (n.__class__, primes.__class__)) if n < 1: raise ValueError("args must be (n < 1) but given %s" % n) res = {1: 1} ok = False while not ok: for prime in primes: if n % prime == 0: if prime in res: res[prime] += 1 else: res[prime] = 1 n = n // prime break if prime > n: ok = True break else: break return Counter(res) if __name__ == '__main__': N, H = map(int, input().split()) A = [abs(int(i)) for i in input().split()] primes = make_primes(H+1) A_factor = reduce(add, (prime_factor(a, primes) for a in A)) h_factor = prime_factor(H, primes) if A_factor & h_factor == h_factor: print("YES") else: print("NO")