Given are a sequence of N positive integers A_1, A_2, \ldots, A_N and another positive integer S.

For a non-empty subset T of the set \{1, 2, \ldots , N \}, let us define f(T) as follows:

 - f(T) is the number of different non-empty subsets \{x_1, x_2, \ldots , x_k \} of T such that A_{x_1}+A_{x_2}+\cdots +A_{x_k} = S.
Find the sum of f(T) over all 2^N-1 subsets T of \{1, 2, \ldots , N \}. Since the sum can be enormous, print it modulo 998244353.

-----Constraints-----
 - All values in input are integers.
 - 1 \leq N \leq 3000
 - 1 \leq S \leq 3000
 - 1 \leq A_i \leq 3000

-----Input-----
Input is given from Standard Input in the following format:
N S
A_1 A_2 ... A_N

-----Output-----
Print the sum of f(T) modulo 998244353.

-----Sample Input-----
3 4
2 2 4

-----Sample Output-----
6

For each T, the value of f(T) is shown below. The sum of these values is 6.
 - f(\{1\}) = 0
 - f(\{2\}) = 0
 - f(\{3\}) = 1 (One subset \{3\} satisfies the condition.)
 - f(\{1, 2\}) = 1 (\{1, 2\})
 - f(\{2, 3\}) = 1 (\{3\})
 - f(\{1, 3\}) = 1 (\{3\})
 - f(\{1, 2, 3\}) = 2 (\{1, 2\}, \{3\})

Difficulty: interview

Starter code:

Solutions:
import numpy as np
n,s=map(int,input().split())
a=list(map(int,input().split()))
mod=998244353
dp=np.zeros([n+1,s+1],int)
dp[0][0]=1
for i in range(1,n+1):
  dp[i][:]=dp[i-1][:]*2
  dp[i][a[i-1]:]+=dp[i-1][:-a[i-1]]
  dp[i][:]%=mod
print(dp[n][s])

import numpy as np

MOD = 998244353

def main():
    n, s = list(map(int, input().split()))
    a = list(map(int, input().split()))
    dp = np.zeros((n+1, s+1), dtype=np.int64)
    dp[0][0] = 1
    for i, v in enumerate(a):
        dp[i+1] += dp[i]*2
        if v <= s:
            dp[i+1][v:] += dp[i][:-v]
        dp[i+1] %= MOD
    print((int(dp[n][s])%MOD))

def __starting_point():
    main()

__starting_point()

import numpy as np
n,s = map(int,input().split())
a = list(map(int,input().split()))
dp = np.zeros(s+1, dtype=np.int64)
"""
dp[i][j] := i番目までを選んで、和がちょうどjのときの場合の数
遷移 → 1増えると全体集合に選ぶ, Aには選ばない, Aに選ぶの3種類.
"""
mod = 998244353
dp[0] = 1
for i in range(n):
	p = (dp * 2) % mod
	p[a[i]:] += dp[:-a[i]]
	dp = p % mod
print(dp[s])

def main():
    import sys
    mod = 998244353
    def input(): return sys.stdin.readline().rstrip()
    n,s = map(int, input().split())
    a = list(map(int, input().split()))
    dp = [0]*(s+1)
    dp[0] = 1
    import numpy as np
    dp = np.array(dp)
    for i in range(n):
        dp[a[i]:] = (2*dp[a[i]:]%mod + dp[:-a[i]])%mod
        dp[:a[i]] *= 2
        dp[:a[i]] %= mod
    print(dp[-1])


def __starting_point():
    main()
__starting_point()

import numpy as np
N, S = [int(_) for _ in input().split()]
A = [int(_) for _ in input().split()]
mod = 998244353
coef = np.zeros(3001, dtype=int)
coef[0] = 1
for a in A:
    coef2 = coef[:-a].copy()
    coef *= 2
    coef[a:] += coef2
    coef %= mod
print((coef[S]))


import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())[:-1]
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [list(input())[:-1] for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
import numpy as np
N,S = list(map(int,input().split()))
MOD = 998244353
A = list(map(int,input().split()))
dp = np.zeros(S+1,dtype = np.int64)
dp[0] = 2
if A[0] <= S:
    dp[A[0]] = 1
for i in range(1,N):
    a = A[i]
    p = dp*2
    if a <= S:
        p[a:] += dp[:-a]
    p %= MOD
    dp = p
print((dp[S]))

    





import numpy as np

N, S = list(map(int, input().split()))
A = np.array(list(map(int, input().split())))
P = 998244353
table = np.zeros((N, S+1), dtype=int)
table[0, 0] = 2
if A[0] <= S:
    table[0, A[0]] = 1
for i in range(1, N):
    Ai = A[i]
    table[i] += 2*table[i-1]
    if Ai <= S:
        table[i][Ai:] += table[i-1][:S-Ai+1]
    table[i] = table[i]%P

print((table[N-1][S]))


import numpy as np

n, s = list(map(int, input().split()))
a = list(map(int, input().split()))
mod = 998244353

dp = np.zeros(s + 1, np.int64)
dp[0] = 1

for e in a:
    pre = dp.copy()

    dp = 2 * pre
    dp[e:] += pre[:-e]
    dp %= mod

ans = dp[s]
print(ans)


import sys
sys.setrecursionlimit(10000000)
MOD = 998244353
INF = 10 ** 15
import numpy as np

def main():
    N,S = map(int,input().split())
    A = list(map(int,input().split()))

    dp = np.zeros(S + 1,np.int64)
    dp[0] = pow(2,N,MOD)
    inv2 = pow(2,MOD - 2,MOD)
    for a in A:
        dp[a:] = np.mod(dp[a:] + dp[:-a] * inv2,MOD)
    print(dp[S])
def __starting_point():
    main()
__starting_point()

import numpy as np
p = 998244353

N,S = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
dp = np.zeros(S+1)
dp[0] = 1
for a in A:
  if S < a:
    dp *= 2
    dp %= p
    continue
  tmp = 2*dp
  dp = np.append(np.zeros(a),dp[:S-a+1])
  dp += tmp
  dp %= p
print(int(dp[S]))

import numpy as np

n,s = map(int, input().split())
a = list(map(int, input().split()))

MOD = 998244353

dp = np.zeros(s+1,dtype=int) #動的計画法を用いる
dp[0] = 1

for i in range(n):
    ddp = dp * 2 % MOD
    ddp[a[i]:] += dp[:-a[i]] #非常に大きな数になると考えられるため先にMOD計算を行う
    dp = ddp % MOD


print(dp[s])

import numpy as np
def main():
    n,s=list(map(int,input().split()))
    A=list(map(int,input().split()))
    dp=np.array([0 for i in range(min(3001,s+1))])
    dp[0]=1
    for ai in A:
        tmp=dp[:-ai].copy()
        #print(tmp)
        dp*=2
        dp[ai:]+=tmp
        dp%=998244353
    print((dp[s]))
    

def __starting_point():
    main()

        


__starting_point()

import numpy as np

N,S = list(map(int, input().split()))
A = list(map(int, input().split()))

MOD = 998244353

dp = np.zeros(S + 1, dtype=int)
dp[0] = 1

for i in A:
    ep = dp.copy()
    ep += dp
    ep[i:] += dp[:-i]
    dp = ep % MOD

print((dp[S]))


mod1,mod2=10**9+7,998244353
mod=mod2
n,s=map(int,input().split())
dp=[0]*(s+1)
dp[0]=1
for a in map(int,input().split()):
    dp=[(2*dp[i]+(0 if i<a else dp[i-a]))%mod for i in range(s+1)]
print(dp[-1])

import numpy as np

N, S = list(map(int, input().split()))
A = list(map(int, input().split()))
mod = 998244353
f = np.zeros(3100, np.int64)

ans = 0
f[0] = 1
for a in A:
    g = f.copy()
    f[a:] += g[:-a]
    f += g
    f %= mod

print((f[S]))



n, s = map(int, input().split())
a = list(map(int, input().split()))
import numpy as np
mod = 998244353
f = np.zeros(3020, np.int64)
f[0] = 1
for b in a:
  ff = 2*f
  ff[b:] += f[:-b]
  ff %= mod
  f = ff
print(f[s])

N,S=map(int,input().split())
A=list(map(int,input().split()))
import numpy as np
d=np.zeros((N+1,S+1),dtype=np.int64)
d[0,0]=1
m=998244353
for i in range(N):
    d[i+1]=d[i]*2%m
    d[i+1,A[i]:]=(d[i+1,A[i]:]+d[i,:-A[i]])%m
print(d[-1,-1])

N,S=list(map(int,input().split()))
A=list(map(int,input().split()))

def f(N,S,A):
    MOD=998244353
    dp=[0]*(S+1)
    dp[0]=pow(2,N,MOD)
    div=pow(2,MOD-2,MOD)
    m=0
    for a in A:
        m+=a
        for i in range(min(m,S),a-1,-1):
            dp[i]=(dp[i]+dp[i-a]*div)%MOD
    return dp[S]

print((f(N,S,A)))


import numpy as np
MOD = 998244353

N,S = list(map(int,input().split()))
A = list(map(int,input().split()))
coefs = np.array([0]*(S+1))
coefs[0] = 1

for i in range(N):
    tmp = coefs[:]
    coefs = coefs*2
    coefs[A[i]:] += tmp[:-A[i]]
    coefs%=MOD
    
print((coefs[-1]))
    



import sys

import numpy as np

input = lambda: sys.stdin.readline().rstrip()
MOD = 998244353

N, S = list(map(int, input().split()))
A = list(map(int, input().split()))

dp = np.zeros(S + 1, np.int64)
dp[0] = 1
for a in A:
    f = 2 * dp
    f[a:] += dp[:-a]
    f %= MOD
    dp = f

print((dp[S]))


#!/usr/bin/env python3
import sys
import numpy as np
def input(): return sys.stdin.readline().rstrip()


def main():
    n, s = list(map(int, input().split()))
    A = list(map(int, input().split()))
    mod = 998244353
    dp = np.zeros(3001, dtype=np.int64)
    dp[0] = 1
    for AA in A:
        dp = dp*2+np.concatenate([np.zeros(AA, dtype=np.int64), dp[:3001-AA]])
        dp %= mod
    print((dp[s]))





def __starting_point():
    main()

__starting_point()

import numpy as np
import sys
input = sys.stdin.readline


def main():
    n, s = map(int, input().split())
    A = np.array([int(i) for i in input().split()])

    MOD = 998244353

    dp = np.zeros(s + 1, dtype="int32")
    dp[0] = 1

    for i in range(n):
        p = (dp * 2) % MOD
        p %= MOD
        p[A[i]:] += dp[:-A[i]]
        dp = p % MOD

    print(dp[s])


def __starting_point():
    main()
__starting_point()

import numpy as np
def finalFunc(n,s,A):
    var=np.array([0 for i in range(min(3001,s+1))])
    var[0]=1
    for i in A:
        tmp=var[:-i].copy()
        var*=2
        var[i:]+=tmp
        var%=998244353
    return var[s]
n,s=map(int,input().split())
A=list(map(int,input().split()))
print(finalFunc(n,s,A))

n,s=map(int,input().split())
a=[int(j)for j in input().split()]
dp=[0]*(3000+1)
dp[0]=1
import numpy as np
pre=np.array(dp)
mod=998244353
for i in a:
    dp=pre*2
    dp[i:]+=pre[:-i]
    dp%=mod
    pre=dp
print(dp[s])

import numpy as np
N,S=map(int,input().split())
As=list(map(int,input().split()))

MOD=998244353

#d = [[0]*3001 for _ in range(3001)]
d=np.zeros((3001,3001))
d[0,0]=1

for i in range(1,N+1):
    Ai=As[i-1]
    d[i] += 2*d[i-1]
    d[i,Ai:] += d[i-1][:-Ai]
    d[i] %= MOD
print(int(d[N][S]))

import numpy as np

MOD = 998244353

N, S = map(int, input().split())
A = np.array(list(map(int, input().split())))

dp = np.zeros((N, S + 1))
dp[0, 0] = 2
if A[0] < S + 1:
	dp[0, A[0]] = 1

for i in range(1, N):
	dp[i, :] = (2 * dp[i - 1, :]) % MOD
	if A[i] > S:
		continue
	dp[i, A[i] : S + 1] += dp[i - 1, 0 : S - A[i] + 1]
	dp[i, :] %= MOD
print(int(dp[N - 1, S]))

import numpy as np
import sys
input = sys.stdin.readline


def main():
    n, s = map(int, input().split())
    A = [int(i) for i in input().split()]

    MOD = 998244353

    dp = np.zeros(s + 1, dtype="int32")
    dp[0] = 1

    for a in A:
        p = (dp * 2) % MOD
        p %= MOD
        p[a:] += dp[:-a]
        dp = p % MOD

    print(dp[s])


def __starting_point():
    main()
__starting_point()

import numpy as np

mod = 998244353

n, s = list(map(int, input().split()))
A = list(map(int, input().split()))
DP = np.zeros(3005, dtype=np.int64)
DP[0] = 1

for a in A:
    double = DP * 2
    shift = np.hstack([np.zeros(a), DP[:-a]]).astype(np.int64)
    DP = double + shift
    DP %= mod

print((DP[s]))


import numpy as np
n,s=map(int, input().split( ))
*a,=map(int, input().split( ))
l=min(s+1,3001)
dp=np.zeros(l,dtype = int)
dp[0]=1
mod=998244353
ans=0
cnt=0
for ai in a:
    #dp2=dp.copy()
    dp2=dp[:-ai].copy()
    dp*=2
    dp[ai:]+=dp2#[:-ai]
    #ans+=dp[s]*pow(2,n-cnt,mod)
    #dp=dp2
    #ans%=mod
    dp%=mod
print(dp[s])

import numpy as np

MOD = 998244353
 
n,s = map(int, input().split())
a = list(map(int,input().split()))


fac_inv2 = pow(2,MOD-2,MOD)

dp = np.zeros(s,"int64")

for i in range(n):
    
    newdp = dp.copy()
    if a[i]<s:
        newdp[a[i]:] += dp[:s-a[i]] * fac_inv2 % MOD
    if a[i]<=s:
        newdp[a[i]-1] += 1
    dp = newdp % MOD

ans = dp[-1]
ans *= pow(2,n-1,MOD)
ans %= MOD
print(ans)

import numpy as np
N, S = list(map(int, input().split()))
a = list(map(int, input().split()))

mod = 998244353


dp = np.zeros(S+1)

dp[0] = 1

for i in range(N):
    tmp = dp*2
    tmp[a[i]:] += dp[:-a[i]]
    dp = tmp % mod

print(int(dp[S]))

import numpy as np
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20

class Polynomial:
    def __init__(self,dim=0,const=1):
        self.values = [(dim,const)]
    def __add__(self,other):
        return self.values + other.values


class PolySolver:
    def __init__(self,size):
        self.size = size
        self.f = np.zeros(size, np.int64)
        self.f[0] = 1


    def multiple(self,polynomial,MOD): # const1 * x^dim1 + const2 * x^dim2 + ... をfにかけ合わせる
        new_F = np.zeros(self.size, np.int64)
        for dim,const in polynomial:
            if dim != 0:
                g = np.zeros(self.size, np.int64)
                g[dim:] += self.f[:-dim]
            else:
                g = const * self.f.copy()
            new_F += g

        self.f = new_F
        self.f %= MOD

    
    def get_coefficient(self,dim):
        return self.f[dim]
    
def main():
    N,S=mi()
    A=list(mi())
    MOD = 998244353

    poly = PolySolver(3010)
    for a in A:
        f = Polynomial(const=2) + Polynomial(dim=a)
        poly.multiple(f,MOD)

    print(poly.get_coefficient(S))



def __starting_point():
    main()
__starting_point()

import numpy as np

N, S = list(map(int, input().split()))
A = tuple(map(int, input().split()))
MOD = 998244353

dp = np.zeros((N + 1, S + 1), dtype=np.int64)
dp[0][0] = 1
for i in range(N):
    dp[i + 1] = dp[i] * 2
    dp[i + 1, A[i]:] += dp[i, :-A[i]]
    dp[i + 1] %= MOD

print((dp[N][S]))


def main():
    import sys
    sys.setrecursionlimit(10**9)
    input = sys.stdin.readline
    import numpy as np

    N, S = map(int, input().split())
    A = list(map(int, input().split()))

    MOD = 998244353

    dp = np.zeros(S + 1, dtype="int32")
    dp[0] = 1

    for i in range(N):
        p = (dp * 2) % MOD
        p[A[i]:] += dp[:-A[i]]
        dp = p % MOD

    print(dp[S])

main()

import numpy as np

mod = 998244353
n, s = map(int, input().split())
dp = np.zeros(s+1, dtype=int)
dp[0] = 1
for a in map(int, input().split()):
  pre_dp = dp
  dp = pre_dp * 2 % mod
  dp[a:] = (dp[a:] + pre_dp[:-a]) % mod
print(dp[-1])

mod = 998244353

N, S, *A = map(int, open(0).read().split())

dp = [1] + [0] * S
for i, a in enumerate(A, 1):
    dp = [(2 * dp[j] + (dp[j - a] if j >= a else 0)) % mod for j in range(S + 1)]

print(dp[S])

def f_knapsack_for_all_subsets_power_series(MOD=998244353, MAX=3010):
    # 参考: https://maspypy.com/atcoder-参加感想-2020-05-31abc-169
    import numpy as np
    N, S = [int(i) for i in input().split()]
    A = [int(i) for i in input().split()]

    f = np.zeros(MAX + 1, np.int64)  # 次数が S より大きな項には興味ないため、こうする
    f[0] = 1  # f_{0}(x) = 1
    for a in A:
        # f_{n+1} = f_{n} * (2 + x**a) = 2 * f_{n} + x**a * f_{n}
        f_next = 2 * f  # 第一項
        f_next[a:] += f[:-a]  # 第二項
        f_next %= MOD
        f = f_next
    return f[S]

print(f_knapsack_for_all_subsets_power_series())

import sys
input = sys.stdin.readline

def solve():
    MOD = 998244353
    inv2 = pow(2, MOD-2, MOD)

    N, S = list(map(int, input().split()))
    As = list(map(int, input().split()))

    dp = [0] * (S+1)
    dp[0] = pow(2, N, MOD)
    for A in As:
        for k in reversed(list(range(S-A+1))):
            dp[k+A] += dp[k] * inv2
            dp[k+A] %= MOD

    print((dp[-1]))


solve()


import numpy as np

mod = 998244353
n, s = map(int, input().split())
dp = np.zeros((n+1, s+1), dtype=int)
dp[0, 0] = 1
for i, a in enumerate(map(int, input().split())):
  dp[i+1] = dp[i] * 2 % mod
  dp[i+1][a:] = (dp[i+1][a:] + dp[i][:-a]) % mod
print(dp[-1, -1])

from copy import copy
import numpy as np
N,S=list(map(int,input().split()))
A=list(map(int,input().split()))
dp=np.zeros(S+100,np.int64)
dp[0]=1
for i in range(N):
    buf=copy(dp)
    dp=2*dp
    dp[A[i]:]+=buf[:-A[i]]
    dp%=998244353
print((dp[S]%998244353))


import numpy as np

n, s = list(map(int, input().split()))
a = [int(i) for i in input().split()]

mod = 998244353
dp = np.zeros(s+1, dtype='i8')
dp[0] = 1
for aa in a:
    tmp = 2 * dp % mod
    tmp[aa:] += dp[:-aa]
    tmp %= mod
    dp = tmp
print((dp[s]))


import numpy as np

mod = 998244353

n, s = list(map(int, input().split()))
A = list(map(int, input().split()))
DP = np.zeros(3005, dtype=np.int64)
DP[0] = 1

for a in A:
    double = DP * 2
    double[a:] += DP[:-a]  # shift
    DP = double % mod

print((DP[s]))


def main():
    mod = 998244353
    n, s = list(map(int, input().split()))
    a = list(map(int, input().split()))
    a = [i for i in a if i <= s]
    dp = [0 for i in range(s+1)]
    half = pow(2, mod-2, mod)
    for i in a:
        dp2 = [j for j in dp]
        dp2[i] = (dp2[i]+pow(2, n-1, mod)) % mod
        for j in range(s-i+1):
            dp2[j+i] = (dp2[j+i]+dp[j]*half) % mod
        dp = dp2
    print((dp[s]))


main()


import numpy as np

n, s = list(map(int, input().split()))
a = list(map(int, input().split()))
mod = 998244353

dp = np.zeros(s + 1, np.int64)
dp[0] = 1

for e in a:
    pre = dp.copy()
    dp = pre * 2
    dp[e:] += pre[:-e]
    dp %= mod

ans = dp[s]
print(ans)


import numpy as np

def main():
    MOD = 998244353
    N, S = map(int, input().split())
    A = list(map(int, input().split()))
    A.sort()
    
    # dp = [[0] * (S + 1) for i in range(N + 1)]
    # dp[0][0] = 1
    
    dp = np.zeros(S + 1, np.int64)
    dp[0] = 1
    
    for i, a in enumerate(A, start=1):
        # i - 1 番目までの数で 合計が X になる組み合わせが
        # dp[i-1][X] 個あるのであれば、
        # そのdp[i-1][X] 個 のそれぞれに対してAi を加える/加えないの
        # 2パターンが考えられるので、dp[i-1]を2倍する
        dp_next = 2 * dp
        
        # さらに、i - 1 番目までの数で 合計が X - Ai になる組み合わせが
        # dp[i-1][X - Ai] 個ある場合、
        # i番目の数(Ai)を足すことで合計をXにできる
        dp_next[a:] += dp[:-a] # dp[:-a] = dp[:len(dp)-a]       

        # 大きくなりすぎないように逐次MODをとる
        dp_next %= MOD
        
        dp = dp_next

    # print(*dp, sep='\n')
    print(dp[S])

def __starting_point():
    main()
__starting_point()

# coding: utf-8
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

MOD = 998244353
N, S = lr()
A = lr()
dp = np.zeros(S+1, np.int64)
dp[0] = 1
for a in A:
    prev = dp.copy()
    dp[a:] += dp[:-a]
    dp += prev
    dp %= MOD

answer = dp[S]
print((answer%MOD))


import numpy as np
MOD = 998244353

def main():
    n, s = map(int, input().split())
    a = list(map(int, input().split()))
    dp = np.zeros((n+1, s+1), dtype=np.int64)
    dp[0][0] = 1
    for i in range(n):
        dp[i][dp[i] >= MOD] %= MOD
        dp[i+1] += dp[i]*2
        if a[i] <= s:
            dp[i+1][a[i]:] += dp[i][:-a[i]]
    print(dp[n][s]%MOD)

def __starting_point():
    main()
__starting_point()

def resolve():
    n, s = list(map(int, input().split()))
    a = list(map(int, input().split()))
    mod = 998244353
    modinv = pow(2, mod - 2, mod)
    dp = [0] * (s + 1)
    dp[0] = pow(2, n, mod)
    for i in a:
        for j in range(s - i, -1, -1):
            dp[j + i] += dp[j] * modinv
            dp[j + i] %= mod
    print((dp[-1]))


def __starting_point():
    resolve()

__starting_point()

import sys
input = sys.stdin.readline
import numpy as np

MOD = 998244353
n, s = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
dp = np.zeros(s+1, dtype=np.int64)
dp[0] = 1
for a in A:
  t = dp.copy() * 2
  t[a:] += dp[:-a]
  t %= MOD
  dp = t
ans = dp[s]
print(ans)

import numpy as np

def main():
    n, s = map(int, input().split())
    a = [int(i) for i in input().split()]
    mod = 998244353
    dp = np.zeros((n + 1, s + 1), dtype=int)
    dp[0][0] = 1
    for i in range(n):
        ai = a[i]
        dp[i + 1] = dp[i] * 2 % mod
        dp[i + 1, ai:] = (dp[i + 1, ai:] + dp[i, :-ai]) % mod
    print(dp[n][s])

def __starting_point():
    main()
__starting_point()

import numpy as np
n,s,*a=map(int,open(0).read().split())
mod=998244353
d=np.zeros(s+1,dtype=np.int64)
d[0]=1
for x in a:
	p=d*2
	if x<=s:
		p[x:]+=d[:s-x+1]
	p%=mod
	d=p
print(d[-1])

import sys
sys.setrecursionlimit(10000000)
MOD = 998244353
INF = 10 ** 15

def main():
    N,S = map(int,input().split())
    A = list(map(int,input().split()))

    dp = [0] * (1 + S)
    dp[0] = pow(2,N,MOD)
    inv2 = pow(2,MOD - 2,MOD)
    for a in A:
        for s in range(S,a - 1,-1):
            dp[s] = (dp[s] + dp[s - a] * inv2)%MOD
    print(dp[S])
def __starting_point():
    main()
__starting_point()

import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())[:-1]
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [list(input())[:-1] for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
import numpy as np
N,S = list(map(int,input().split()))
MOD = 998244353
A = list(map(int,input().split()))
dp = np.zeros(3003,dtype = np.int64)
dp[0] = 2
if A[0] <= S:
    dp[A[0]] = 1
for i in range(1,N):
    a = A[i]
    p = dp*2
    p[a:] += dp[:-a]
    p %= MOD
    dp = p
print((dp[S]))

    





import numpy as np
N, S = list(map(int, input().split()))
A = np.array(list(map(int, input().split())))
P = 998244353
table = np.zeros((N, S+1), dtype=int)
table[0, 0] = 2
if A[0] <= S:
  table[0, A[0]] = 1
for i in range(1, N):
  Ai = A[i]
  table[i] += 2*table[i-1]
  if Ai <= S:
    table[i][Ai:] += table[i-1][:S-Ai+1]
  table[i] = table[i]%P
print((table[N-1][S]))




import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())[:-1]
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [list(input())[:-1] for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
import numpy as np
N,S = list(map(int,input().split()))
MOD = 998244353
A = list(map(int,input().split()))
dp = np.zeros(S+1,dtype = np.int64)
dp[0] = 2
if A[0] <= S:
    dp[A[0]] = 1
for i in range(1,N):
    a = A[i]
    p = dp*2
    if a <= S:
        p[a:] += dp[:-a]
    p %= MOD
    dp = p
print((dp[-1]))

    





import numpy as np

MOD = 998244353

N, S = list(map(int, input().split(' ')))
A = (0, *list(map(int, input().split(' '))))

dp = np.zeros(shape=(N + 1, S + 1), dtype=int)
dp[0][0] = 1

for i in range(1, N + 1):
    a = A[i]
    dp[i] = 2 * dp[i - 1] % MOD
    dp[i][a:] += dp[i - 1][:-a]
    dp[i] %= MOD

print((dp[N][S]))


import numpy as np

mod = 998244353

n, s = list(map(int, input().split()))
A = list(map(int, input().split()))
DP = np.zeros(3005, dtype=np.int64)

for num, a in enumerate(A):
    double = DP * 2
    shift = np.hstack([np.zeros(a), DP[:-a]]).astype(np.int64)
    DP = double + shift
    DP[a] += pow(2, num, mod)
    DP %= mod

print((DP[s]))


import numpy as np
import sys
input = sys.stdin.readline


def main():
    n, s = map(int, input().split())
    A = np.array([int(i) for i in input().split()])

    MOD = 998244353

    dp = np.zeros(s + 1, dtype="int32")
    dp[0] = 1

    for a in A:
        p = (dp * 2) % MOD
        p %= MOD
        p[a:] += dp[:-a]
        dp = p % MOD

    print(dp[s])


def __starting_point():
    main()
__starting_point()

import numpy as np

N,S = map(int, input().split())
A = list(map(int, input().split()))

MOD = 998244353

dp = np.zeros(S + 1, dtype=int)
dp[0] = 1

for i in A:
    ep = dp * 2
    ep[i:] += dp[:-i]
    dp = ep % MOD

print(dp[S])

import numpy as np
import numba
from typing import List


@numba.jit
def solver(N: int, S: int, A: np.array) -> int:
    dp = np.zeros((N+1, S+1), dtype=np.int64)

    dp[0,0] = 1
    MOD = 998244353
    for i in range(N):
        for j in range(S+1):
            dp[i+1, j] += 2 * dp[i, j]
            dp[i+1, j] %= MOD
            if j + A[i] <= S:
                dp[i+1, j+A[i]] += dp[i, j]
                dp[i+1, j+A[i]] %= MOD
    return dp[N,S]


def main():
    N, S = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]

    ans = solver(N, S, np.array(A))
    print(ans)
 
 
def __starting_point():
    import sys
    sys.setrecursionlimit(10000)
    main()
__starting_point()

import math
import numpy as np
import queue
from collections import deque,defaultdict
import heapq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    n,s = list(map(int,ipt().split()))
    a = [int(i) for i in ipt().split()]
    mod = 998244353
    two = [1]*(n+1)
    for i in range(n):
        two[i+1] = two[i]*2%mod
    dp = np.zeros(3010,dtype = int)
    dp[0] = 1
    for i,ai in enumerate(a):
        ndp = dp*2
        ndp[ai:] += dp[:-ai]
        ndp %= mod
        dp = ndp
    print((dp[s]))
    return

def __starting_point():
    main()

__starting_point()

def main():
    N, S = list(map(int, input().split()))
    A = list(map(int, input().split()))
    return solve(N, S, A)

def solve(N, S, A):
    mod = 998244353
    dp = [0] * (S + 1)
    dp[0] = pow(2, N, mod)
    div2 = pow(2, mod - 2, mod)
    m = 0
    for a in A:
        m += a
        for i in reversed(list(range(a, min(S, m) + 1))):
            dp[i] = (dp[i] + dp[i - a] * div2) % mod
    return dp[S]

print((main()))


import numpy as np
def main():
    n,s=list(map(int,input().split()))
    A=list(map(int,input().split()))
    dp=np.array([0 for i in range(s+1)])
    dp[0]=1
    for ai in A:
        tmp=dp[:-ai].copy()
        #print(tmp)
        dp*=2
        dp[ai:]+=tmp
        dp%=998244353
    print((dp[s]))
    

def __starting_point():
    main()

__starting_point()

import numpy as np

MOD = 998244353

N, S = map(int, input().split())
As = list(map(int, input().split()))

dp = np.zeros((N+1, S+1), np.int64)
dp[0][0] = 1
for n, A in enumerate(As):
    dp[n+1, :] = dp[n, :] * 2
    dp[n+1, A:] += dp[n, :-A]
    dp[n+1] %= MOD

print(dp[N, S])

import numpy as np
N, S = [int(_) for _ in input().split()]
A = [int(_) for _ in input().split()]
dp = np.array([0] * (3001), dtype=int)
dp[0] = 2
dp[A[0]] = 1
mod = 998244353
for a in A[1:]:
    dpn = np.zeros(3001, dtype=int)
    dpn[a:] = dp[:-a]
    dpn += dp * 2
    dpn %= mod
    dp = dpn
print((dp[S]))


K = 96
N, S = map(int, input().split())
A = [int(a) for a in input().split()]
P = 998244353
pa = (1 << 64) - ((1 << 64) % P)
m = int(("1" * 32 + "0" * 64) * 3030, 2)
modP = lambda x: x - ((x & m) >> 64) * pa
s = 1 << K * S
for a in A:
    s = 2 * s + (s >> K * a)
    s = modP(s)
print((s & ((1 << K) - 1)) % P)

def main():
    import sys
    import numpy as np
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    N, S = [int(x) for x in input().strip().split()]
    An = [int(x) for x in input().strip().split()]
    dp = np.zeros((S+1), dtype=int)
    dp[0] = 2
    if An[0] <= S:
        dp[An[0]] = 1

    for n in range(1, N):
        dp *= 2
        dp[An[n]:] += dp[:-An[n]] // 2
        dp %= 998244353

    print(dp[S])
                
def __starting_point():
    main()
__starting_point()

n,s=list(map(int,input().split()))
a=list(map(int,input().split()))
mod=998244353
import numpy as np
dp=np.zeros((n+1,3001),int)
# dp[j]:総和がjになるようにできる空でない部分集合の個数。
dp[0][0]=1 # 遷移用、実際は0

for i in range(n):
  dp[i+1]+=dp[i]*2
  dp[i+1,a[i]:]+=dp[i,:-a[i]]
  dp[i+1]%=mod
print((dp[n][s]))

#print(dp)


#!python3

iim = lambda: list(map(int, input().rstrip().split()))

def resolve():
    N, S = iim()
    A = list(iim())
    mod = 998244353
    S1 = S + 1

    dp = [0] * (S+1)

    dp[0] = pow(2, N, mod)
    inv = pow(2, mod-2, mod)

    for ai in A:
        for i in range(S, ai-1, -1):
            dp[i] = (dp[i] + dp[i-ai]*inv) % mod

    print((dp[-1]))


def __starting_point():
    resolve()

__starting_point()