#include<bits/stdc++.h>

//#include

//#include

//#include

//#include

//#include

//#include

//#include

using namespace std;

#define max(a, b) (a < b ? b : a)

#define min(a, b) ((a > b) ? b : a)

#define FOR(a, c) for (int(a) = 0; (a) < ©; (a)++)

#define FORL(a, b, c) for (int(a) = (b); (a) <= ©; (a)++)

#define FORR(a, b, c) for (int(a) = (b); (a) >= ©; (a)–)

#define INF 1000000000000000003

#define ip(a,n) for(int i=0;i<n;i++) cin>>a[i]; //self

#define op(a,n) for(int i=0;i<n;i++) cout<<a[i]<<’ ';cout<<endl;

typedef long long int ll;

typedef vector vi;

typedef pair<int, int> pi;

#define F first

#define S second

#define PB push_back

#define POB pop_back

#define MP make_pair

#define ll long long int

const int mod = 1e9 + 7;

void solve() {

// arary rotation

ll i, j, k, l, m, n, p, x, y, z;

cin >> n;

long long int a[n];

ip(a, n);

ll ans = 0;

ans = accumulate(a, a + n, 0);

// for (int i = 0; i < n; ++i)

// {

// /* code */
// ans += a[i];
// ans = (ans + mod ) % mod;
// }
// cout << ans ;
ans %= mod;
ans += mod;
int q;
cin >> q;
for (int i = 0; i < q; i++)
{
/* code */

cin >> x;

ans = ans * 2;

ans %= mod;

cout << ans << endl;

}

// cout << mod;

}

int main() {

#ifndef ONLINE_JUDGE

```
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
// freopen("inp_corner_test_case.txt", "r", stdin);
// freopen("out_corner_test_case.txt", "w", stdout);
```

#endif

```
// int t;
// cin >> t;
// while (t--) {
solve();
// }
return 0;
```

}