#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
long long n, s;
long long a[3005];
long long ans;
long long dp[3005][3005][3];
int main() {
  cin >> n >> s;
  for (int i = 0; i < n; i++) cin >> a[i];
  dp[0][0][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = s; j >= 0; j--) {
      if (j - a[i] >= 0) {
        dp[i + 1][j][1] += dp[i][j - a[i]][0];
        dp[i + 1][j][2] += dp[i][j - a[i]][1];
        dp[i + 1][j][1] += dp[i][j - a[i]][1];
        dp[i + 1][j][2] += dp[i][j - a[i]][0];
      }
      dp[i + 1][j][0] += dp[i][j][0];
      dp[i + 1][j][1] += dp[i][j][1];
      dp[i + 1][j][2] += dp[i][j][1];
      dp[i + 1][j][1] += dp[i][j][0];
      dp[i + 1][j][2] += dp[i][j][2];
    }
  }
  cout << dp[n][s][2] % mod << endl;
}
