#include <bits/stdc++.h>
using namespace std;
int dp[3005][3005], coin[3005], n, b[3005];
int nn;
int dpcall(int i, int val) {
  if (i >= nn) {
    if (val == 0) return 1;
    return 0;
  }
  if (dp[i][val] != -1) return dp[i][val];
  dp[i][val] = 0;
  for (int j = 0; j <= b[i] && val - coin[i] * j >= 0; j++) {
    dp[i][val] += dpcall(i + 1, val - coin[i] * j) % 998244353;
  }
  return dp[i][val] % 998244353;
}
int main() {
  int k;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) b[i] = 1;
  for (int i = 0; i < n; i++) scanf("%d", coin + i);
  long long re = 0;
  for (int ii = 0; ii < n; ii++) {
    for (int j = ii; j < n; j++) {
      nn = j + 1;
      memset(dp, -1, sizeof(dp));
      re = (re + dpcall(ii, k)) % 998244353;
    }
  }
  printf("%lld\n", re);
  return 0;
}
