#include <bits/stdc++.h>
using namespace std;
const int maxn = 3000 + 5;
const long long mod = 998244353;
int n;
int boundary;
int arr[maxn];
long long dp[maxn][maxn];
long long solve(int pos, int sum) {
  if (sum == 0) {
    int rem = n - pos + 1;
    return 1;
  }
  if (pos < boundary or sum < 0) {
    return 0;
  }
  long long &ret = dp[pos][sum];
  if (~ret) {
    return ret;
  }
  ret = solve(pos - 1, sum);
  ret = (ret + solve(pos - 1, sum - arr[pos])) % mod;
  return ret;
}
void Task() {
  int sum;
  cin >> n >> sum;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    memset(dp, -1, sizeof dp);
    boundary = i;
    long long res = solve(n, sum);
    int total = 0;
    for (int j = i; j <= n; j++) {
      long long fromHere = max(0LL, dp[j][sum]);
      total = (total + fromHere) % mod;
    }
    ans = (ans + total) % mod;
  }
  cout << ans << endl;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  if (fopen("in.txt", "r")) {
    freopen("in.txt", "r", stdin);
  }
  int tc = 1;
  while (tc--) {
    Task();
  }
}
