import math N, K = map(int, input().split()) *A, = map(int, input().split()) MOD = 998244353 div = [] for I in range(1, K + 1): if I ** 2 > K: break if K % I == 0: div.append(I) if I ** 2 < K: div.append(K // I) div.sort() ZA = {V:I for I, V in enumerate(div)} L = len(ZA) NX = [[0] * L for _ in range(L)] for I in range(L): for J in range(1, L): NX[I][J] = NX[J][I] = ZA[math.gcd(div[I] * div[J], K)] DP = [0] * L DP[0] = 1 for I in A: ID = ZA[math.gcd(I, K)] for R in range(L)[::-1]: NID = NX[ID][R] V = DP[R] DP[NID] = (DP[NID] + V) % MOD print(DP[-1] - (K == 1))