#include <bits/stdc++.h>
using namespace std;
constexpr long long MAXN = 100;
constexpr long long MOD = 1000000007;
constexpr long long MAXTOLERANCE = 300001;
long long c[MAXN], b[MAXN], magic[MAXN];
long long dp1[MAXTOLERANCE], dp2[MAXTOLERANCE];
long long coalesce[MAXTOLERANCE + 1];
long long* const coal = coalesce + MAXTOLERANCE / 2;
int32_t main() {
  ios_base::sync_with_stdio(false);
  long long n, q;
  cin >> n;
  for (long long i = 0; i < n; ++i) {
    cin >> c[i];
  }
  for (long long i = 1; i < n; ++i) {
    cin >> b[i];
  }
  cin >> q;
  for (long long j = 0; j < q; ++j) {
    long long x;
    cin >> x;
    magic[0] = x;
    for (long long i = 1; i < n; ++i) {
      magic[i] = magic[i - 1] + b[i];
    }
    long long* prev = dp1 + MAXTOLERANCE / 2;
    fill_n(prev - MAXTOLERANCE / 2, MAXTOLERANCE, 0);
    prev[x] = 1;
    long long* curr = dp2 + MAXTOLERANCE / 2;
    for (long long i = 0; i < n - 1; ++i) {
      fill_n(coal - MAXTOLERANCE / 2, MAXTOLERANCE + 1, 0);
      for (long long k = -MAXTOLERANCE / 2; k <= MAXTOLERANCE / 2; ++k) {
        long long start = max(k, 0ll);
        if (start <= c[i]) {
          long long c_start =
              min(max(magic[i + 1] - (c[i] - k), -MAXTOLERANCE / 2),
                  MAXTOLERANCE / 2 + 1);
          long long c_end =
              min(max(magic[i + 1] - (start - k) + 1, -MAXTOLERANCE / 2),
                  MAXTOLERANCE / 2 + 1);
          coal[c_start] += prev[k];
          coal[c_start] %= MOD;
          coal[c_end] += (MOD - prev[k]);
          coal[c_end] %= MOD;
        }
      }
      long long cum = 0;
      for (long long k = -MAXTOLERANCE / 2; k <= MAXTOLERANCE / 2; ++k) {
        cum += coal[k];
        cum %= MOD;
        curr[k] = cum;
      }
      swap(prev, curr);
    }
    long long ans = 0;
    {
      fill_n(curr - MAXTOLERANCE / 2, MAXTOLERANCE, 0);
      for (long long k = -MAXTOLERANCE / 2; k <= MAXTOLERANCE / 2; ++k) {
        long long start = max(k, 0ll);
        for (long long kk = start; kk <= c[n - 1]; ++kk) {
          ans += prev[k];
          ans %= MOD;
        }
      }
    }
    cout << ans << '\n';
  }
}
