#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i ++)
#define mx 500005
#define mod 1000000007
#define LL long long
using namespace std;


long long f[105][10005], SUM[10005], lim[105];
int c[105], n, b[105];

long long calc(int id, int sum) {	
	if (f[id][sum] > -1) return f[id][sum];
	if (id && sum < lim[id - 1]) return 0ll;
	if (id == n) return 1ll;
	f[id][sum] = 0ll;
	for (int i = 0; i <= c[id]; i ++) f[id][sum] = (calc(id + 1, sum + i) + f[id][sum]) % mod;
	return f[id][sum];
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
//	freopen("out.txt", "w", stdout);
#endif

	cin.tie(0); cout.tie(0);
	ios::sync_with_stdio(0);

	int ss = 0;
	
	cin >> n;
	for (int i = 0; i < n ; i ++) cin >> c[i], ss += c[i];
	for (int i = 0; i < n - 1; i ++) cin >> b[i];
	
	int q, x;
	memset(f, -1, sizeof(f));
	cin >> q;
	q = 1;
	while(q --) {
		cin >> x;
		lim[0] = x;
		for (int i = 0; i < n - 1; i ++) x += b[i], lim[i + 1] = lim[i] + x;
		cout << calc(0, 0) << endl;
	} 
	return 0;
}

