#include <bits/stdc++.h>
using namespace std;
template <typename T>
void chmin(T &a, T b) {
  if (a > b) a = b;
}
template <typename T>
void chmax(T &a, T b) {
  if (a < b) a = b;
}
int in() {
  int x;
  scanf("%d", &x);
  return x;
}
long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
int main() {
  int N, S, mod = 998244353;
  cin >> N >> S;
  vector<int> A(N + 1);
  for (int i = 0; i < N; ++i) cin >> A[i + 1];
  vector<vector<int> > dp(N + 1, vector<int>(S + 5, 0));
  for (int i = 0; i < N + 1; ++i) dp[i][0] = 1;
  for (int i = 1; i <= N; ++i) {
    for (int s = 0; s <= S; ++s) {
      if (s - A[i] >= 0)
        dp[i][s] += dp[i - 1][s] + dp[i - 1][s - A[i]];
      else
        dp[i][s] += dp[i - 1][s];
      dp[i][s] %= mod;
    }
  }
  int ans = 0;
  for (int i = 1; i <= N; ++i) ans += dp[i][S];
  cout << ans << endl;
  return 0;
}
