#include <bits/stdc++.h>
using namespace std;
long long MOD = 998244353;
int main() {
  int n, k;
  cin >> n >> k;
  vector<vector<int>> dp(n + 1, vector<int>(k + 1, 0));
  for (long long i = 0; i < (long long)n + 1; i++) dp[i][0] = 1;
  for (long long i = 0; i < (long long)n; i++) {
    int in;
    cin >> in;
    for (long long j = 0; j < (long long)k + 1; j++) {
      dp[i + 1][j] += dp[i][j];
      if (j + in <= k) dp[i + 1][j + in] += dp[i][j];
    }
  }
  long long ans = 0;
  for (long long i = 0; i < (long long)n + 1; i++) (ans += dp[i][k]) %= MOD;
  cout << ans << endl;
}
