#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, S;
  scanf("%d %d", &N, &S);
  int A[N];
  for (int i = 0; i < N; i++) scanf("%d", &A[i]);
  long long P = 998244353;
  long long h[N][S + 1];
  for (int s = 0; s < S; s++) h[0][s] = 0;
  h[0][A[0]] = 1;
  for (int n = 0; n < N; n++) h[n][0] = n + 2;
  for (int n = 1; n < N; n++)
    for (int s = 1; s < S + 1; s++) {
      h[n][s] = h[n - 1][s];
      if (s >= A[n]) h[n][s] += h[n - 1][s - A[n]];
      h[n][s] %= P;
    }
  long long ans = 0;
  for (int n = 0; n < N; n++) ans = (ans + h[n][S]) % P;
  printf("%lld", ans);
}
