#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using i128 = __int128_t;
using u128 = __uint128_t;
using u64 = uint64_t;
const long long MOD = 1000000007;
const long double PI = 3.141592653589793238;
const long long pi = 31415926;
const long long inf = 1000000000000000000;
const long long small_inf = INT_MAX;
const long long N = 200;
long long modpow(long long x, long long n = MOD - 2, long long mod = MOD) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * x % mod;
    x = x * x % MOD;
    n >>= 1;
  }
  return res;
}
long long power(long long x, long long n) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * x;
    x = x * x;
    n >>= 1;
  }
  return res;
}
long long add(long long x, long long y) { return (x + y) % MOD; }
long long mult(long long x, long long y) { return (x * y) % MOD; }
void init() {}
void solve() {
  long long n;
  cin >> n;
  std::vector<long long> c(n + 1, 0);
  std::vector<long long> b(n + 1, 0);
  for (long long i = 1; i <= n; i++) {
    cin >> c[i];
  }
  for (long long i = 1; i <= n - 1; i++) {
    cin >> b[i];
  }
  long long q;
  cin >> q;
  long long y;
  std::vector<long long> sum(n + 1, 0);
  cin >> sum[1];
  for (long long i = 2; i <= n; i++) {
    sum[i] = sum[i - 1] + b[i - 1];
  }
  std::vector<std::vector<long long> > dp(n + 1,
                                          std::vector<long long>(10001, 0));
  for (long long i = 0; i <= c[1]; i++) {
    dp[1][i] = 1;
  }
  for (long long i = 2; i <= n; i++) {
    for (long long x = 0; x <= c[i]; x++) {
      for (long long j = 10000; j >= x; j--) {
        dp[i][j] += dp[i - 1][j - x];
        dp[i][j] %= MOD;
      }
    }
  }
  long long ans = 0;
  for (long long i = 10000; i >= sum[n]; i--) {
    ans += dp[n][i];
    ans %= MOD;
  }
  cout << ans << endl;
}
void clear_global() {}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  long long t23 = 1, tt23 = 1;
  init();
  while (tt23 <= t23) {
    solve();
    tt23++;
    clear_global();
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
}
