import sys from collections import Counter readline=sys.stdin.readline N,K=map(int,readline().split()) A=list(map(int,readline().split())) mod=998244353 C=Counter(A) DP=[1] s=0 for a in sorted(list(C.keys())): c=C[a] dp=[[[0]*(s*c+1) for j in range(c+1)] for i in range(s+1)] dp[0][0][0]=1 for i in range(s+1): for j in range(c+1): for k in range(s*c+1): if i: dp[i][j][k]+=dp[i-1][j][k] if j and k-i>=0: dp[i][j][k]+=dp[i][j-1][k-i] dp[i][j][k]%=mod PREV=DP DP=[0]*((s+c)*(s+c-1)//2+1) for i in range(s*(s-1)//2+1): for j in range(s*c+1): DP[i+j]+=PREV[i]*dp[-1][-1][j] DP[i+j]%=mod s+=c ans=DP[K] print(ans)