#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 998244353;
ll a[3030], dp[3030];
int main() {
  int n, s;
  cin >> n >> s;
  for (int i = 0; i < n; ++i) cin >> a[i];
  ll unko = 0;
  for (int i = 0; i < n; ++i) {
    dp[0] += 1;
    for (int j = s; j >= 0; --j) (dp[j + a[i]] += dp[j]) %= MOD;
    (unko += dp[s]) %= MOD;
  }
  cout << unko << '\n';
  return 0;
}
