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 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))



if __name__ == "__main__":

    main()
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))



if __name__ == "__main__":

    main()

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 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))


if __name__ == "__main__":
    main()

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))


if __name__ == "__main__":
    main()

-    for i in range(n): -        dp[i][dp[i] >= MOD] %= MOD +    for i, v in enumerate(a): -        if a[i] <= s: -            dp[i + 1][a[i] :] += dp[i][: -a[i]] -    print((dp[n][s] % MOD)) +        if v <= s: +            dp[i + 1][v:] += dp[i][:-v] +        dp[i + 1] %= MOD +    print((int(dp[n][s]) % MOD))