import math from collections import Counter def prime_numbers(x): if x < 2: return [] prime_numbers = [i for i in range(x)] prime_numbers[1] = 0 for prime_number in prime_numbers: if prime_number > math.sqrt(x): break if prime_number == 0: continue for composite_number in range(2 * prime_number, x, prime_number): prime_numbers[composite_number] = 0 return [prime_number for prime_number in prime_numbers if prime_number != 0] primes = prime_numbers(10 ** 6) def soinnsuu(x): l = [] for i in primes: if i > int(math.sqrt(x)) + 1: break elif x % i == 0: while x % i == 0: x //= i l.append(i) if not x == 1: l.append(x) return Counter(l) n, h = map(int, input().split()) h = dict(soinnsuu(h)) a = list(map(int, input().split())) if 0 in a: exit(print("YES")) for i in a: for j, k in dict(soinnsuu(abs(i))).items(): try: h[j] = max(0, h[j] - k) except: pass if all(i == 0 for i in h.values()): print("YES") else: print("NO")