#include <bits/stdc++.h>
#define mod (int)(1e9+7)
using namespace std;

int n, t, q, x, i, j;
long long sum = 1;
int b[110], c[110], sp[110], f[10204], mp[1200000], sc[110], s[10204];

int main()
{
	cin >> n;
	for (i = 1; i <= n; i ++ ) cin >> c[i], sum = 1ll * sum * (c[i] + 1) % mod, sc[i] = sc[i - 1] + c[i];
	for (int i = 1; i < n; i ++ ) cin >> b[i], sp[i + 1] = sp[i] + b[i];
	for (int i = 2; i <= n; i ++ ) sp[i] += sp[i - 1];
	cin >> q;
	memset(mp, -1, sizeof mp);
	while (q -- )
	{
		cin >> x;
		if (mp[x + 500000] != -1) { cout << mp[x + 500000] << endl; continue; }
		for (i = 1; i <= n; i ++ ) if (x * i + sp[i] > 0) break;
		if (i > n) { cout << sum << endl; continue; }
		for (i = 1; i <= n; i ++ ) if (x * i + sp[i] > sc[i]) break;
		if (i <= n) { puts("0"); continue; }
		int l = 0; memset(f, 0, sizeof f);
		s[0] = f[0] = 1;
		for (i = 1; i <= n; i ++ )
		{
			int L = l;
			l = max(l, x * i + sp[i]);
			for (j = sc[i - 1] + 1; j <= sc[i]; j ++ ) s[j] = s[j - 1];
			for (j = sc[i]; j >= l; j -- ) f[j] = (s[j] - (j - c[i] - 1 >= L ? s[j - c[i] - 1] : 0)) % mod;
			if (l) s[l - 1] = 0;
			for (j = l; j <= sc[i]; j ++ ) s[j] = ((j ? s[j - 1] : 0) + f[j]) % mod;
		}
		mp[x + 500000] = (s[sc[n]] % mod + mod) % mod;
		cout << mp[x + 500000] << endl;
	}
	return 0;
}