N,H=map(int, input().split()) A=list(map(int, input().split())) d=1 for i in A: d*=i e=d%H if e==0: print('YES') exit() else: d=e print('NO')