using System; using System.Collections.Generic; using System.Linq; class Program { static void Main(string[] args) { var input = Console.ReadLine().Split().Select(int.Parse).ToArray(); int n = input[0]; int k = input[1]; var a = Console.ReadLine().Split().Select(int.Parse).ToList(); var dp = new List>(); for (int i = 0; i <= n; i++) dp.Add(new Dictionary()); dp[0][1] = 1; for (int x = 1; x <= n; x++) { int ai = Gcd(a[x - 1], k); foreach (var y in dp[x - 1].Keys.ToList()) { if (!dp[x].ContainsKey(y)) dp[x][y] = 0; dp[x][y] += dp[x - 1][y]; dp[x][y] %= 998244353; int z = Gcd(y * ai, k); if (!dp[x].ContainsKey(z)) dp[x][z] = 0; dp[x][z] += dp[x - 1][y]; dp[x][z] %= 998244353; } } int ans = dp[n][k]; if (k == 1) ans -= 1; Console.WriteLine(ans); } static int Gcd(int a, int b) { if (a < b) return Gcd(b, a); while (b != 0) { int r = a % b; a = b; b = r; } return a; } }