#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e+18 + 1;
const long long MOD = 998244353LL;
string abc = "abcdefghijklmnopqrstuvwxyz";
string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
vector<long long> dx = {-1, -1, -1, 0, 0, 1, 1, 1};
vector<long long> dy = {1, -1, 0, 1, -1, 1, 0, -1};
long long dp[3010][3010];
int main() {
  long long n, s;
  cin >> n >> s;
  vector<long long> a(n + 1);
  for (long long i = 0; i < (long long)(n); i++) cin >> a[i + 1];
  dp[1][0] = 1;
  dp[1][a[1]] = 1;
  for (long long i = 2; i <= n; i++) {
    for (long long j = 0; j < (long long)(s + 1); j++) {
      dp[i][j] += 2 * dp[i - 1][j];
      dp[i][j] -= dp[i - 2][j];
      if (j >= a[i]) dp[i][j] += dp[i - 1][j - a[i]] - dp[i - 2][j - a[i]];
      dp[i][j] % MOD;
    }
    dp[i][0]++;
    dp[i][a[i]]++;
  }
  cout << dp[n][s] % MOD << endl;
}
