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 mx = 100 mx2 = 2505 dd = [[[0]*(mx+1) for _ in range(mx+1)] for _ in range(mx2)] for s in range(mx2): for j in range(1, mx+1): for lim in range(mx+1): if j == 1: if s <= lim: dd[s][j][lim] = 1 else: dd[s][j][lim] = 0 elif s == 0: dd[s][j][lim] = 1 elif s > lim*j: dd[s][j][lim] = 0 else: dd[s][j][lim] = (dd[s-j][j][lim-1]+dd[s][j-1][lim])%md from collections import Counter n, k = LI() aa = LI() aa.sort() ac = Counter(aa) dp = [0]*(k+1) dp[0] = 1 pa = -1 for i, a in enumerate(aa): if a == pa: continue dp1 = dp dp = [0]*(k+1) c = ac[a] for j in range(k+1): pre = dp1[j] if pre == 0: continue for nj in range(j, k+1): diff = nj-j if diff>i*c:break dp[nj] += pre*dd[diff][c][i]%md dp[nj] %= md pa = a # p2D(dp) print(dp[k])