mod = 998244353 class fenwick_tree: def __init__(self, n, init=None): self.n = n self.tree = [0] * (n + 1) if init: for i in range(n): self.add(i, init[i]) def add(self, k, x): while k < self.n: self.tree[k] = (self.tree[k] + x) % mod k |= k + 1 def prefix_sum(self, i): s = 0 i -= 1 while i >= 0: s += self.tree[i] i = (i & (i + 1)) - 1 return s % mod def floor_sum(n, m, a, b): # sum [i = 0, ..., n-1] floor((ai+b)/m) ans = 0 while True: ans += (n - 1) * n * (a // m) // 2 a %= m ans += n * (b // m) b %= m y = (a * n + b) // m x = y * m - b if y == 0: return ans ans += (n - (x + a - 1) // a) * y n, m, a, b = y, a, m, (-x) % a N, M = map(int, input().split()) D = list(map(int, input().split())) I = [0] + [pow(M // i, mod - 2, mod) for i in range(1, M + 1)] All = 1 for i in range(N): All *= M // D[i] All %= mod B = 80 cnt1 = [[0] * (B + 1) for i in range(M + 1)] cnt2 = [[0] * (M + 1) for i in range(B + 1)] c = [0] * (B + 1) for i in range(N): for j in range(1, B + 1): cnt1[D[i]][j] += c[j] if D[i] <= B: c[D[i]] += 1 ans = 0 c = [0] * (B + 1) ft = fenwick_tree(M + 1) for i in range(N - 1, -1, -1): if D[i] > B: for j in range(1, B + 1): cnt2[j][D[i]] += c[j] for j in range(D[i], M + 1, D[i]): ans += ft.prefix_sum(j) * I[D[i]] ans %= mod for j in range(D[i], M + 1, D[i]): ft.add(j, I[D[i]]) else: c[D[i]] += 1 for i in range(1, M + 1): for j in range(1, B + 1): if cnt1[i][j] != 0: ans += cnt1[i][j] * floor_sum(M // j, i, j, j - 1) % mod * I[i] % mod * I[j] ans %= mod for i in range(1, B + 1): for j in range(1, M + 1): if cnt2[i][j] != 0: ans += cnt2[i][j] * floor_sum(M // j, i, j, j - 1) % mod * I[i] % mod * I[j] ans %= mod ans *= All print(ans % mod)