#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 3010;
const int mod = 998244353;
vector<int> a;
int n;
ll dp[N][N][2];
ll solve(int L, int S, bool started) {
  if (S == 0) return n - L + 1;
  if (S < 0) return 0;
  if (L >= n) return 0;
  ll &ans = dp[L][S][started];
  if (ans != -1) return ans;
  int x = a[L];
  if (!started)
    return ans = (solve(L + 1, S, true) + solve(L + 1, S, false)) % mod;
  else {
    return ans = (solve(L + 1, S - x, true) + solve(L + 1, S, true)) % mod;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int second;
  cin >> n >> second;
  a.resize(n);
  for (auto &i : a) cin >> i;
  memset(dp, -1, sizeof dp);
  cout << solve(0, second, true) + solve(0, second, false) << '\n';
  return 0;
}
