n,k=map(int,input().split()) a=list(map(int,input().split())) mod=998244353 if k==1: print(pow(2,n,mod)-1) exit() import math from collections import defaultdict a=[math.gcd(i,k) for i in a] d=defaultdict(int) d[1]=1 for i in a: d2=d.copy() for j in d2: m=math.gcd(k,i*j) d[m]=(d2[j]+d[m])%mod print(d[k]%mod)