import sys from collections import defaultdict sys.setrecursionlimit(10**7) def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int,sys.stdin.readline().rstrip().split()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI2(): return list(map(int,sys.stdin.readline().rstrip())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) def LS2(): return list(sys.stdin.readline().rstrip()) N,K = MI() A = LI() mod = 998244353 count = defaultdict(int) for a in A: count[a] += 1 B = list(count.keys()) M = len(B) B.sort() X = [[[0]*(K+1) for _ in range(N+1)] for _ in range(N+1)] X[0][0][0] = 1 for i in range(1,N+1): for j in range(N+1): for k in range(K+1): for l in range(j+1): if (i-1)*l > k: break X[i][j][k] += X[i-1][j-l][k-(i-1)*l] X[i][j][k] %= mod dp = [[0]*(K+1) for _ in range(M+1)] dp[1][0] = 1 s = count[B[0]] for i in range(1,M): c = count[B[i]] XX = X[s+1][c] for j in range(K+1): d = dp[i][j] if not d: continue for k in range(K+1): if j+k > K: continue dp[i+1][j+k] += d*XX[k] dp[i+1][j+k] %= mod s += c ans = dp[-1][-1] print(ans)