#include <bits/stdc++.h>
using namespace std;
string _reset = "\u001b[0m", _yellow = "\u001b[33m", _bold = "\u001b[1m";
void DBG() { cerr << "]" << _reset << endl; }
template <class H, class... T>
void DBG(H h, T... t) {
  cerr << to_string(h);
  if (sizeof...(t)) cerr << ", ";
  DBG(t...);
}
const int INF = 1e9 + 7, N = 105, M = 1e9 + 7;
int c[N], b[N], at_least[N], dp[N][N * N];
void add(int& a, int b) {
  a += b;
  if (a >= M) a -= M;
}
signed main() {
  std::ios::sync_with_stdio(0);
  std::cin.tie(0);
  ;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> c[i];
  for (int i = 1; i <= n - 1; i++) cin >> b[i];
  int q, x;
  cin >> q >> x;
  assert(q == 1);
  for (int i = 1; i <= n; i++) {
    at_least[i] = i * x;
    for (int j = 1; j <= i; j++)
      for (int k = 1; k < j; k++) at_least[i] += b[k];
  }
  dp[0][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = at_least[i]; j < N * N; j++)
      if (dp[i][j]) {
        int need = max(at_least[i + 1] - j, 0);
        for (int k = need; k <= c[i + 1]; k++) {
          add(dp[i + 1][j + k], dp[i][j]);
        }
      }
  }
  int ans = 0;
  for (int j = 0; j < N * N; j++) add(ans, dp[n][j]);
  cout << ans << '\n';
}
