def encoding(s): n = len(s) begin, cnt = 0, 0 ans = [] if n == 0: return ans for end in range(n + 1): if end == n or s[begin] != s[end]: ans.append((s[begin], cnt)) begin, cnt = end, 1 else: cnt += 1 return ans n, k = map(int, input().split()) a = list(map(int, input().split())) MOD = 998244353 a = sorted(a) comp = encoding(a) cnts = [cnt for _, cnt in comp] dp = [0] * (k + 1) dp[0] = 1 ru_cnt = 0 for cnt in cnts: dq = [0] * (k + 1) coeff = [[0] * (cnt + 1) for _ in range(k + 1)] coeff[0][0] = 1 for i in range(ru_cnt + 1): tmp = [[0] * (cnt + 1) for _ in range(k + 1)] for use in range(cnt + 1): for used in range(cnt + 1): if use + used >= cnt + 1: break for val in range(k + 1): if val + i * use < k + 1: tmp[val + i * use][used + use] += coeff[val][used] tmp[val + i * use][used + use] %= MOD else: break coeff, tmp = tmp, coeff for count in range(k + 1): for j in range(k + 1): if count + j < k + 1: dq[count + j] += dp[count] * coeff[j][-1] dq[count + j] %= MOD ru_cnt += cnt dp, dq = dq, dp print(dp[-1] % MOD)