#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1e9 + 7;
const int N = 103;
const int SUM = 101 * 101;
int dp[N][SUM];
int n, a[N];
void solve() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  int sum = 0;
  for (int i = 0; i < n - 1; ++i) {
    int b;
    cin >> b;
    sum += b;
  }
  int x;
  cin >> x >> x;
  dp[0][0] = 1;
  for (int i = 0; i < n; ++i) {
    for (int cur_sum = 0; cur_sum < SUM; ++cur_sum) {
      if (dp[i][cur_sum] == 0) continue;
      for (int nxt = 0; nxt <= a[i + 1]; ++nxt) {
        dp[i + 1][cur_sum + nxt] =
            (dp[i + 1][cur_sum + nxt] + dp[i][cur_sum]) % MOD;
      }
    }
  }
  int res = 0;
  for (int i = max(0, x + sum); i < SUM; ++i) res += dp[n][i];
  cout << res << "\n";
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
