#include <bits/stdc++.h>
using namespace std;
const int N = 105, mod = 1000000007;
int n, m, x, b[N], c[N], dp[N][N * N], l, r, ans;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &c[i]);
  for (int i = 2; i <= n; i++) scanf("%d", &b[i]), b[i] += b[i - 1];
  scanf("%d%d", &m, &x), dp[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    l += b[i] + x, r += c[i];
    for (int j = max(l, 0); j <= r; j++) {
      for (int k = 0; k <= c[i]; k++) {
        assert(j - k < N * N);
        dp[i][j] = (dp[i][j] + dp[i - 1][j - k]) % mod;
      }
    }
  }
  for (int i = max(l, 0); i <= r; i++) ans = (ans + dp[n][i]) % mod;
  printf("%d", ans);
  return 0;
}
