#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  if (0) return;
  cout << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  if (0) return;
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
inline void INP();
const long long N = 3e6 + 7, M = 998244353, inf = INT_MAX;
const long long INF = LLONG_MAX;
long long n, Q, s;
long long arr[N + 2];
long long dp[3002][3002];
long long subset(long long id, long long sum) {
  if (sum < 0) return 0;
  if (!sum) return id + 1;
  if (id == 0) return 0;
  long long& mafia = dp[id][sum];
  if (mafia != -1) return mafia;
  long long a = 0, b = 0;
  a = subset(id - 1, sum);
  b = subset(id - 1, sum - arr[id]);
  return mafia = (a + b) % M;
}
void solve() {
  cin >> n >> s;
  for (long long i = 1; i < (long long)n + 1; i++) cin >> arr[i];
  long long ans = 0;
  memset(dp, -1, sizeof dp);
  for (long long i = 1; i < (long long)n + 1; i++) ans += subset(i, s);
  cout << ans;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) solve();
}
inline void INP() {}
