mod = 998244353 max_kai = 10**6+10 kai = [1] for i in range(1, max_kai): kai.append(kai[-1] * i % mod) kkai = [0] * max_kai kkai[-1] = pow(kai[-1], mod - 2, mod) for i in reversed(range(1, max_kai)): kkai[i - 1] = kkai[i] * i % mod kkai_sum = [0]*(max_kai+1) for i in range(max_kai): kkai_sum[i+1] = (kkai_sum[i] + kkai[i]) % mod def cutsum(a, b): return kkai_sum[a] - kkai_sum[max(0, b)] def fft_inplace(a, w): n = len(a) m = n t = 1 while m >= 2: mh = m >> 1 for i in range(0, n, m): for s, j, k in zip(range(mh), range(i, n), range(i+mh, n)): a[j], a[k] = (a[j]+a[k]) % mod, (a[j]-a[k])*w[s*t] % mod m = mh t *= 2 def ifft_inplace(a, w): n = len(a) m = 2 t = -(n >> 1) while m <= n: mh = m >> 1 for i in range(0, n, m): for s, j, k in zip(range(mh), range(i, n), range(i+mh, n)): a[k] *= w[s*t] a[j], a[k] = (a[j]+a[k]) % mod, (a[j]-a[k]) % mod m <<= 1 t //= 2 n_inv = pow(n, mod-2, mod) for i in range(n): a[i] = a[i] * n_inv % mod def convolution(a, b): n2 = max(len(a) + len(b), 1) n = 1 << (n2-1).bit_length() a = a + [0] * (n-len(a)) b = b + [0] * (n-len(b)) w_root = pow(3, (mod-1)//n, mod) w = [1] * n for i in range(1, n): w[i] = w[i-1] * w_root % mod fft_inplace(a, w) fft_inplace(b, w) for i, j in enumerate(b): a[i] *= j ifft_inplace(a, w) return a[:n2] n, k = map(int, input().split()) m = [int(i)+1 for i in input().split()] b = convolution(m, m[::-1]) ans = 0 for i in range(n): ans += b[i] * (kai[n-1] * cutsum(n-1, n-k-1) - kai[i]*cutsum(i, i-k)) ans %= mod for i in m: ans *= i-1 ans %= mod ans *= pow(4, mod-2, mod) ans %= mod print(ans)