// #pragma GCC optimize("Ofast,unroll-loops")
#include <climits>
#include <unordered_map>
#include <random>
#include <chrono>
#include <numeric>
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <bitset>
#include <string>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cmath>
#include <cassert>
#include <list>
#include <forward_list>
#include <set>
#include <unordered_set>
#include <cstdint>
#include <utility>
// #pragma GCC target("avx2,fma")
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
#define all(x) begin(x), end(x)
#define X first
#define Y second
#define isz(x) ((int)size(x))
const int MOD = 1e9 + 7;
class int_mod {
ll value;
public:
int_mod() : value(0) {}
int_mod(ll a) {
if (a >= MOD) a %= MOD;
value = a;
}
int_mod operator+(int_mod other) {
ll res = this->value + other.value;
if (res >= MOD) res -= MOD;
return res;
}
int_mod operator-(int_mod other) {
ll res = this->value - other.value;
if (res < 0) res += MOD;
return res;
}
int_mod operator*(int_mod other) {
long long res = 1LL * this->value * other.value;
if (res >= MOD) {
res %= MOD;
}
return res;
}
int_mod operator+(ll other) { return *this + int_mod(other); }
int_mod operator-(ll other) { return *this - int_mod(other); }
int_mod operator*(ll other) { return *this * int_mod(other); }
int_mod operator=(int_mod other) { return value = other.value; }
int_mod operator=(ll other) { return *this = int_mod(other); }
int_mod operator+=(int_mod other) { return *this = *this + other; }
int_mod operator-=(int_mod other) { return *this = *this - other; }
int_mod operator*=(int_mod other) { return *this = *this * other; }
explicit operator ll() { return value; }
};
std::istream& operator>>(std::istream& is, int_mod &imod) {
ll x;
is >> x;
imod = x;
return is;
}
std::ostream& operator<<(std::ostream& os, int_mod imod) {
return os << (ll)imod;
}
const int MAXN = 3010;
const int MAXSUM = 10010;
int_mod binpow(int_mod a, int b) {
if (!b) return 1;
if (b & 1) return binpow(a, b - 1) * a;
auto x = binpow(a, b / 2);
return x * x;
}
const int_mod INV2 = binpow(2, MOD - 2);
int_mod dp[MAXN][MAXSUM];
int a[MAXN];
void solve() {
int n;
cin >> n;
for (int i = 0; i < n; ++i) cin >> a[i];
int sum;
cin >> sum;
for_each(all(dp), [](int_mod v[]) {
fill(v, v + MAXSUM, 0);
});
dp[0][0] = binpow(2, n);
for (int i = 0; i < n; ++i) {
for (int j = 0; j <= sum; ++j) {
dp[i + 1][j] = dp[i][j];
if (j - a[i] >= 0) dp[i + 1][j] += dp[i][j - a[i]] * INV2;
}
}
cout << dp[n][sum] << '\n';
}
signed main() {
cin.tie(0)->sync_with_stdio(0);
#ifdef LOCAL
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
#endif
int t = 1;
// cin >> t;
while (t --> 0) solve();
return 0;
}