#include <bits/stdc++.h>
using namespace std;
const int maxn = 3005;
const int mod = 998244353;
int a[maxn], num[maxn];
int main() {
  int n, s;
  scanf("%d%d", &n, &s);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    memset(num, 0, sizeof(num));
    num[0] = 1;
    for (int j = i; j <= n; j++) {
      for (int pre = s; pre - a[j] >= 0; pre--)
        num[pre] = (num[pre] + num[pre - a[j]]) % mod;
      ans = (ans + num[s]) % mod;
    }
  }
  printf("%d\n", ans);
  return 0;
}
