import sys # sys.setrecursionlimit(200005) int1 = lambda x: int(x)-1 p2D = lambda x: print(*x, sep="\n") def II(): return int(sys.stdin.readline()) def LI(): return list(map(int, sys.stdin.readline().split())) def LI1(): return list(map(int1, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def LLI1(rows_number): return [LI1() for _ in range(rows_number)] def SI(): return sys.stdin.readline().rstrip() # dij = [(0, 1), (-1, 0), (0, -1), (1, 0)] dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)] inf = 10**16 md = 998244353 # md = 10**9+7 from functools import lru_cache @lru_cache(None) def divide(s, n, lim): if s > lim*n: return 0 if n == 1: return 1 res = 0 for a in range(s+1): if a*n > s: break res += divide(s-a*n, n-1, lim) return res def RLE(s): kk = [] vv = [] for c in s: if kk and kk[-1] == c: vv[-1] += 1 else: kk.append(c) vv.append(1) return kk, vv from collections import Counter n, k = LI() aa = LI() aa.sort() ac = Counter(aa) dp = [[0]*(k+1) for _ in range(n+1)] dp[0][0] = 1 pa = -1 for i, a in enumerate(aa): if a == pa: continue c = ac[a] for j in range(k+1): pre = dp[i][j] if pre == 0: continue for nj in range(j, k+1): diff = nj-j dp[i+c][nj] = (dp[i+c][nj]+pre*divide(diff, c, i))%md pa = a # p2D(dp) print(dp[n][k])