#include <bits/stdc++.h>
using namespace std;
typedef bool BL;
typedef char SB;
typedef unsigned char UB;
typedef short SW;
typedef unsigned short UW;
typedef long SDW;
typedef unsigned long UDW;
typedef long long SLL;
typedef unsigned long long ULL;
typedef char CH;
typedef float R32;
typedef double R64;
const ULL mod = 998244353;
const ULL inf = 0x7fffffff;
const ULL infLL = 0x7fffffffffffffffLL;
const UDW maxN = 3e3 + 7;
SDW N, S;
SDW A[maxN];
SLL dp[maxN][maxN][3];
SLL ans;
void input() {
  cin >> N >> S;
  for (register SDW i = (1); i <= (N); ++i) {
    cin >> A[i];
  }
}
void solve() {
  for (register SDW i = (1); i <= (N); ++i) {
    for (register SDW j = (1); j <= (S); ++j) {
      dp[i][j][0] = dp[i - 1][j][2];
      dp[i][j][1] = dp[i - 1][j][1];
      dp[i][j][2] = dp[i - 1][j][2];
      if (A[i] <= j) {
        dp[i][j][1] += dp[i - 1][j - A[i]][1];
        dp[i][j][2] += dp[i - 1][j - A[i]][2];
        dp[i][j][1] %= mod;
        dp[i][j][2] %= mod;
      }
    }
  }
  ans = dp[N][S][2];
}
void output() { cout << ans << endl; }
int main() {
  input();
  solve();
  output();
  return 0;
}
