#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 3005;
const ll m = 998244353;
using ii = pair<int, int>;
int n, s, a[N], dp[N][N], r;
ll add(ll a, ll b) { return ((a % m) + (b % m)) % m; }
int f(int curr, int rem) {
  if (curr > r) return rem == 0;
  int &sol = dp[curr][rem];
  if (sol != -1) return sol;
  sol = f(curr + 1, rem);
  if (rem >= a[curr]) sol += f(curr + 1, rem - a[curr]);
  return sol;
}
int main() {
  scanf("%d%d", &n, &s);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  int sol = 0;
  for (r = 1; r <= n; r++) {
    memset(dp, -1, sizeof dp);
    for (int l = 1; l <= n; l++) {
      if (l > r) continue;
      sol = add(sol, f(l, s));
    }
  }
  printf("%d\n", sol);
  return 0;
}
