#include <bits/stdc++.h>
using namespace std;
using ll = long long;

const int N = 211;
const int mod = 1e9 + 7;

int n, c[N], b[N], q, x, d[N], s[N];
int dp[N][12315];

int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; ++i)
		scanf("%d", &c[i]);
	for (int i = 1; i < n; ++i)
		scanf("%d", &b[i]);
	scanf("%d%d", &q, &x);
	s[1] = x, d[1] = x;
	for (int i = 2; i <= n; ++i) {
		d[i] = d[i - 1] + b[i - 1];
		s[i] = s[i - 1] + d[i];
	}

	dp[0][0] = 1;
	int sc = 0;
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j <= sc; ++j)
			for (int k = 0; k <= c[i + 1]; ++k)
				if (j + k >= s[i + 1]) {
					dp[i + 1][j + k] = (dp[i + 1][j + k] + dp[i][j]) % mod;
				}
		sc += c[i + 1];
	}
	int ans = 0;
	for (int j = 0; j <= sc; ++j)
		ans = (ans + dp[n][j]) % mod;
	printf("%d\n", ans);
	return 0;
}

//~ int main() {
	//~ long long a, b, c, d;
	//~ cin >> a >> b  >> c >> d;
	//~ cout << a * 4 + b * 12 + c * 12 + d * 4 << endl;
	//~ long long a, b;
	//~ scanf("%lld%lld", &a, &b);
	//~ printf("%lld\n", __gcd(a, b));
	//~ printf("%lld %lld\n", a / __gcd(a,b), b / __gcd(a, b));
	//~ return 0;
//~ }

//~ C(52,10) = 15820024220
//~ C(48,9) = 1677106640
//~ C(48,8) = 377348994
//~ C(48,7) = 73629072
//~ C(48,6) = 12271512
//~ 12169249400 15820024220
