#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 6;
const int mod = 998244353;
template <typename T>
int O(T s) {
  cout << s << endl;
  return 0;
}
template <typename T>
void db(T *bg, T *ed) {
  while (bg != ed) cout << *bg++ << ' ';
  printf("\n");
}
template <typename T>
void db(vector<T> it) {
  for (auto i : it) cout << i << ' ';
  printf("\n");
}
inline long long mul_64(long long x, long long y, long long c) {
  return (x * y - (long long)((long double)x / c * y) * c + c) % c;
}
inline long long ksm(long long a, long long b, long long c) {
  long long ans = 1;
  for (; b; b >>= 1, a = a * a % c)
    if (b & 1) ans = ans * a % c;
  return ans;
}
inline void exgcd(long long a, long long b, long long &x, long long &y) {
  if (!b)
    x = 1, y = 0;
  else
    exgcd(b, a % b, y, x), y -= (a / b) * x;
}
long long dp[2][3005];
;
int n, s;
int a[N];
int main() {
  cin >> n >> s;
  for (int i = 0; i++ < n; scanf("%d", &a[i]))
    ;
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = s; j >= a[i]; j--) {
      dp[0][j] += dp[0][j - a[i]];
      dp[0][j] %= mod;
    }
    dp[1][i] = dp[0][s];
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j++) {
      ans += dp[1][j] - dp[1][i];
      if (a[i] == s) ans++;
      ans = (ans + mod) % mod;
    }
  }
  O(ans);
}
