#include <bits/stdc++.h>
using namespace std;
struct edge {
  long long to;
  long long w;
};
static const long long max_n = 3010;
static const long long mod = 998244353;
vector<long long> dp(max_n, 0);
vector<long long> value_list(max_n);
long long N, S;
int main() {
  long long ans = 0, u, v;
  scanf("%lld %lld", &N, &S);
  for (long long i = 0; i < N; i++) {
    scanf("%lld", &u);
    value_list[i] = u;
  }
  for (long long i = 0; i < N; i++) {
    (dp[0] += 1) %= mod;
    vector<long long> dp2(max_n, 0);
    for (long long w = 0; w <= S; w++) {
      if (w + value_list[i] <= S) {
        (dp2[w + value_list[i]] += dp[w]) %= mod;
      }
      ((dp2[w] += dp[w])) %= mod;
    }
    dp = dp2;
    ans += dp[S];
  }
  printf("%lld\n", ans);
  return 0;
}
