#include <bits/stdc++.h>
using namespace std;
long long N, S;
long long A[3010];
long long dp[3010][6010];
const long long MOD = 998244353;
signed main() {
  cin >> N >> S;
  for (long long i = 0; i < (long long)N; ++i) cin >> A[i];
  for (long long i = 0; i < (long long)N; ++i) dp[i][0] = 1;
  dp[0][A[0]] = 1;
  for (long long i = 1; i < N; ++i) {
    for (long long j = 2 * S; j >= 0; --j) {
      dp[i][j] = dp[i - 1][j];
      if (j - A[i] >= 0) dp[i][j] += dp[i - 1][j - A[i]];
      dp[i][j] %= MOD;
    }
  }
  long long ans = 0;
  for (long long i = 0; i < (long long)N; ++i) {
    ans += dp[i][S];
    ans %= MOD;
  }
  for (long long i = 0; i < (long long)N; ++i) {
    for (long long j = 0; j < (long long)2 * S + 1; ++j) {
      printf("dp[%lld][%lld] = %lld\n", i, j, dp[i][j]);
    }
    printf("\n");
  }
  cout << ans << endl;
}
