N,K=map(int,input().split()) import math B=[int(x) for x in input().split()] A=sorted([math.gcd(a,K) for a in B]) mod=998244353 dp=dict() dp[1]=1 dp2=dp.copy() for i in range(N): a=A[i] for k in dp: p = k * math.gcd(K//k,a) if not p in dp2: dp2[p]=0 dp2[p]+=dp[k] dp2[p]%=mod dp=dp2.copy() if K in dp: print(dp[K]) else: print(0)