N,H = map(int,input().split()) A = list(map(int,input().split())) flg = 0 MOD = 10**9+7 num = 1 for a in A: num *= a if num%H == 0: flg = 1 break num %= MOD if flg: print("YES") else: print("NO")