#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
long long dp[101][10010], dp2[10010];
int a[101], b[101], c[101];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
  }
  for (int i = 0; i < n - 1; i++) {
    scanf("%d", b + i);
  }
  int q, x, X;
  scanf("%d %d", &q, &x);
  X = x;
  long long S = x;
  c[0] = x;
  for (int i = 0; i < n - 1; i++) {
    x += b[i];
    S += x;
    c[i + 1] = x;
  }
  long long ans = 0;
  for (int i = max(X, 0); i <= a[0]; i++) {
    long long tmp = 1;
    for (int j = 1; j < n; j++) {
      int tmp2 = c[0] + c[j];
      int tmp3 = 0;
      if (a[j] + i >= tmp2) tmp3 = a[j] + i - tmp2 + 1;
      if (tmp3 >= a[j] + 1) tmp3 = a[j] + 1;
      tmp *= tmp3;
      tmp %= MOD;
    }
    ans += tmp;
    ans %= MOD;
  }
  printf("%lld\n", ans);
  return 0;
}
