#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1000005;
const long long SQRTN = 1003;
const long long LOGN = 22;
const double PI = acos(-1);
const long long INF = 1e16;
const long long MOD = 1000000007;
const long long FMOD = 998244353;
const double eps = 1e-9;
void solvethetestcase();
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  for (long long testcase = 1; testcase < t + 1; testcase++) {
    solvethetestcase();
  }
}
long long n;
long long c[MAXN], b[MAXN], q, x;
long long dp[105][100005];
void solvethetestcase() {
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> c[i];
  long long sm = 0;
  for (long long i = 0; i < n - 1; i++) {
    cin >> b[i];
    sm += b[i] * (n - i - 1);
  }
  cin >> q >> x;
  sm += n * x;
  dp[0][0] = 1;
  long long cur = x;
  for (long long i = 1; i < n + 1; i++) {
    for (long long j = 0; j < n * 100 + 1; j++) {
      dp[i][j] = 0;
      if (j < cur) continue;
      for (long long k = 0; k < c[i - 1] + 1; k++) {
        if (k > j) break;
        dp[i][j] = (dp[i][j] + dp[i - 1][j - k]) % MOD;
      }
    }
    cur += x;
    for (long long j = 0; j < i; j++) cur += b[i];
  }
  long long ans = 0;
  for (long long i = max(0LL, sm); i < 100 * n + 1; i++)
    ans = (ans + dp[n][i]) % MOD;
  cout << ans << "\n";
}
