#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
const long long int N = 3e3 + 10, mod = 998244353;
long long long long int dp[N][N];
long long long long int a[N];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long long long int n, s;
  cin >> n >> s;
  dp[0][0] = 1;
  for (long long int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (long long int i = 1; i <= n; i++) {
    for (long long int j = 0; j < N; 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 long long int ans = 0;
  for (long long int i = 1; i <= n; i++) ans += dp[i][s];
  cout << ans % mod << '\n';
}
