from math import gcd from collections import defaultdict n, h = map(int, input().split()) A = list(map(int, input().split())) H = defaultdict(int) hc = h while h % 2 == 0: H[2] += 1 h //= 2 f = 3 while f * f <= hc: while h % f == 0: H[f] += 1 h //= f f += 2 if h != 1: H[h] += 1 Cnt = defaultdict(int) for i in range(n): r = gcd(A[i], hc) rc = r while r % 2 == 0: Cnt[2] += 1 r //= 2 f = 3 while f * f <= rc: while r % f == 0: Cnt[f] += 1 r //= f f += 2 if r != 1: Cnt[r] += 1 for prime in H.keys(): if H[prime] > Cnt[prime]: print("NO") exit() print("YES")