#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int n, c[110], b[110], sum[110], sum1[110], dp[110][10010], ans, Min, T, x;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &c[i]), sum1[i] = sum1[i - 1] + c[i];
  for (int i = 1; i < n; i++)
    scanf("%d", &b[i]), sum[i] = sum[i - 1] + b[i], Min = Min + sum[i];
  scanf("%d%d", &T, &x);
  Min += x * n;
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= sum1[i]; j++)
      for (int k = min(j, c[i]); k >= 0; k--)
        dp[i][j] = ((dp[i][j] + dp[i - 1][j - k] >= mod)
                        ? dp[i][j] + dp[i - 1][j - k] - mod
                        : dp[i][j] + dp[i - 1][j - k]);
  for (int i = max(Min, 0); i <= sum1[n]; i++)
    ans = ((ans + dp[n][i] >= mod) ? ans + dp[n][i] - mod : ans + dp[n][i]);
  printf("%d\n", ans);
  return 0;
}
