#include <bits/stdc++.h>
const int maxn = 3e3 + 10;
const int mod = 998244353;
int n, s;
int memo[maxn][maxn], vs[maxn];
using namespace std;
int sum(int x, int v) { return ((x % mod + v % mod) + mod) % mod; }
int dp(int pos, int soma) {
  if (pos > n) return 0;
  if (soma == s) return 1;
  int &val = memo[pos][soma];
  if (val != -1) return val;
  val = sum(dp(pos + 1, soma), dp(pos + 1, soma + vs[pos]));
  return val;
}
void solve() {
  memset(memo, -1, sizeof memo);
  cin >> n >> s;
  int ans = 0;
  for (int i = 0; i < n; ++i) cin >> vs[i];
  for (int i = 0; i < n; ++i) {
    ans = sum(ans, dp(i, 0));
  }
  cout << ans << endl;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
