#include <bits/stdc++.h>
using namespace std;
const long long N = 105;
const long long MOD = 1000000007;
long long n;
long long suff[N];
long long dp[N][N * N];
long long pref[N][N * N];
long long val[N], c[N], b[N], x[N];
long long cnt = 0;
long long raw[N][N * N];
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> c[i];
  for (long long i = 1; i < n; i++) cin >> b[i];
  long long q, x;
  cin >> q;
  suff[n + 1] = 1;
  for (long long i = n; i >= 1; i--) suff[i] = suff[i + 1] * (c[i] + 1) % MOD;
  dp[0][0] = 1;
  for (long long j = 0; j < N * N; j++) pref[0][j] = 1;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j < N * N; j++) {
      long long l = max<long long>(0, j - c[i]);
      long long r = j;
      dp[i][j] = pref[i - 1][r] - (l > 0 ? pref[i - 1][l - 1] : 0);
      dp[i][j] = (dp[i][j] + MOD) % MOD;
    }
    pref[i][0] = dp[i][0];
    for (long long j = 1; j < N * N; j++)
      pref[i][j] = (dp[i][j] + pref[i][j - 1]) % MOD;
  }
  vector<pair<long long, long long>> qq;
  vector<long long> id(n + 1, 0);
  for (long long i = 1; i <= q; i++) {
    long long x;
    cin >> x;
    qq.push_back({x, i});
  }
  sort(qq.begin(), qq.end());
  vector<long long> ress(q + 1);
  long long res = 0;
  for (long long i = 0; i < N; i++) {
    for (long long j = 0; j < N * N; j++) raw[i][j] = dp[i][j];
  }
  for (auto que : qq) {
    long long x = que.first;
    long long cur = x;
    for (long long i = 1; i <= n; i++) {
      val[i] = val[i - 1] + cur;
      cur += b[i];
    }
    for (long long i = 1; i <= n; i++) {
      while (id[i] < N * N && id[i] < val[i]) {
        res += dp[i][id[i]] * suff[i + 1];
        res %= MOD;
        if (i < n)
          for (long long j = i; j < min(id[i] + c[i + 1], N * N); j++) {
            dp[i + 1][j] -= raw[i][id[i]];
            dp[i + 1][j] = (dp[i + 1][j] + MOD) % MOD;
          }
        id[i]++;
      }
    }
    ress[que.second] = (suff[1] - res + MOD) % MOD;
  }
  for (long long i = 1; i <= q; i++) {
    cout << ress[i] << '\n';
  }
  return 0;
}
