#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("O3")
#pragma GCC target("avx2")
using namespace std;
using LL = long long int;
using uLL = unsigned long long int;
using uint = unsigned int;
using ld = long double;
const int M = 998244353;
int dp[3007], noms[3007];
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(0);
  int n, s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    cin >> noms[i];
  }
  dp[0] = 1;
  int ans = 0;
  for (int l = 0; l < n; l++) {
    for (int r = l; r < n; r++) {
      int x = noms[r];
      for (int k = s; k >= x; k--) {
        dp[k] += dp[k - x];
        dp[k] -= M * (dp[k] >= M);
      }
      ans += dp[s];
      ans -= (ans >= M) * M;
    }
    for (int k = 1; k <= s; k++) {
      dp[k] = 0;
    }
  }
  cout << ans << '\n';
  return 0;
}
