n,h=map(int,input().split()) A=list(map(int,input().split())) ans=1 for i in range(n): ans*=(A[i]%998244353) if ans%h==0: print("YES") else: print("NO")