#include <bits/stdc++.h>

#define MAXN 111
#define BASE 1000000007

using namespace std;

int n;
int b[MAXN], c[MAXN];
int x, q;
int Dp[MAXN][MAXN * MAXN];
int prefixSumB[MAXN];

int DpCalc(int curPos, int sum) {
  if (curPos == n) {
    if (sum >= n * x + prefixSumB[n - 1]) return 1;
    return 0;
  }
  if (Dp[curPos][sum] > -1) return Dp[curPos][sum];
  int res = 0;
  for (int a = 0; a <= c[curPos]; a++) {
    if (sum + a >= x * (curPos + 1) + prefixSumB[curPos]) {
      res = ((long long)res + DpCalc(curPos + 1, sum + a)) % BASE;
    }
  }
  Dp[curPos][sum] = res;
  return res;
}

int main() {
  cin >> n;
  int total = 0;
  for (int i = 0; i < n; i++) {
    cin >> c[i];
    total += c[i];
  } 
  b[0] = prefixSumB[0] = 0;
  int sumB = 0;
  for (int i = 1; i < n; i++) {
    cin >> b[i];
    sumB += b[i];
    prefixSumB[i] = prefixSumB[i - 1] + sumB;
  }
  cin >> q >> x;
  for (int i = 0; i < n; i++) {
    for (int sum = 0; sum <= total; sum++) {
      Dp[i][sum] = -1;
    }
  }
  cout << DpCalc(0, 0) << endl;
  return 0;
}