#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110, MAXM = 1e4 + 10, moder = 1e9 + 7;
int n, c[MAXN], b[MAXN], q, x;
long long f[MAXN][MAXM], sum[MAXN], sum2[MAXN], ans;
int main() {
  cin >> n;
  for (long long i = (1); i <= (n); i++) cin >> c[i];
  for (long long i = (1); i <= (n - 1); i++) cin >> b[i];
  cin >> q >> x;
  for (long long i = (1); i <= (n); i++) {
    sum2[i] = sum2[i - 1] + c[i];
    sum[i] = i * x;
    for (long long j = (1); j <= (i - 1); j++) {
      sum[i] += (i - j) * b[j];
    }
  }
  f[0][0] = 1;
  for (long long i = (0); i <= (n - 1); i++) {
    for (long long j = (0); j <= (sum2[i]); j++) {
      long long L = (0 > sum[i + 1] - j ? 0 : sum[i + 1] - j), R = c[i + 1];
      for (long long k = (L); k <= (R); k++) {
        f[i + 1][j + k] = (f[i + 1][j + k] + f[i][j]) % moder;
      }
    }
  }
  long long L = sum[n], R = sum2[n];
  for (long long i = (L); i <= (R); i++) {
    ans = (ans + f[n][i]) % moder;
  }
  cout << ans << endl;
  return 0;
}
