#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const long long linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 998244353;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, s;
  cin >> n >> s;
  vector<long long> a(n);
  for (int i = 0; i < ((int)n); i++) cin >> a[i];
  long long ans = 0;
  long long dp[n + 1][3010];
  for (int i = 0; i < ((int)n); i++) {
    dp[i][0] += 1;
    for (long long j = 3010 - 1; j >= 0; j--) {
      dp[i + 1][j] += dp[i][j];
      dp[i + 1][j] %= MOD;
      if (j - a[i] >= 0) dp[i + 1][j] += dp[i][j - a[i]];
      dp[i + 1][j] %= MOD;
    }
    ans = (ans + dp[i + 1][s]) % MOD;
  }
  cout << ans << endl;
}
