#include using namespace std; const long long MOD = 998244353; int main(){ int N, K; cin >> N >> K; vector A(N); for (int i = 0; i < N; i++){ cin >> A[i]; } map mp; for (int i = 0; i < N; i++){ mp[A[i]]++; } vector dp(K + 1, 0); dp[0] = 1; int S = 0; for (auto P : mp){ int cnt = P.second; vector>> dp2(S + 2, vector>(cnt + 1, vector(K + 1, 0))); dp2[0][0][0] = 1; for (int i = 0; i <= S; i++){ for (int j = 0; j <= cnt; j++){ for (int k = 0; k <= K; k++){ if (dp2[i][j][k] != 0){ for (int l = 0; l <= cnt - j; l++){ if ((S - i) * l <= K - k){ int k2 = k + (S - i) * l; dp2[i + 1][j + l][k2] += dp2[i][j][k]; dp2[i + 1][j + l][k2] % MOD; } } } } } } vector dp3(K + 1, 0); for (int i = 0; i <= K; i++){ for (int j = 0; j <= K - i; j++){ dp3[i + j] += dp[i] * dp2[S + 1][cnt][j] % MOD; dp3[i + j] %= MOD; } } swap(dp, dp3); S += cnt; } cout << dp[K] << endl; }