#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e2+50;//注意修改大小
const int maxm=1e4+50;
const int MAXM=1e5+50;
const ll Mod=1e9+7;
long long read(){long long x=0,f=1;char c=getchar();while(!isdigit(c)){if(c=='-') f=-1;c=getchar();}while(isdigit(c)){x=x*10+c-'0';c=getchar();}return x*f;}
ll qpow(ll x,ll q,ll Mod){ll ans=1;while(q){if(q&1)ans=ans*x%Mod;q>>=1;x=(x*x)%Mod;}return ans%Mod;}
ll n,q,a[maxn],b[maxn],c[maxn],api[maxn],bpi[maxn],cpi[maxn],bppi[maxn],ans[2*MAXM],dp[2][MAXM];
int main(){
    // ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    cin>>n;
    for(int i=1;i<=n;i++)cin>>c[i];
    for(int i=1;i<=n-1;i++)cin>>b[i];
    for(int i=1;i<=n-1;i++)bpi[i]=bpi[i-1]+b[i];
    for(int i=1;i<=n-1;i++)bppi[i]=bppi[i-1]+bpi[i];
    for(int i=1;i<=n;i++)cpi[i]=cpi[i-1]+c[i];
    // for(int i=1;i<=n;i++)cout<<cpi[i]<<' ';cout<<endl;
    // for(int i=1;i<n;i++)cout<<cpi[i]<<' ';cout<<endl;
    // for(int i=1;i<n;i++)cout<<bppi[i]<<' ';cout<<endl;
    cin>>q;
    for(int i=0;i<=2e5;i++)ans[i]=-1;
    ll up=-1e18,down=1e18,maxxc=0;
    for(int i=1;i<=n;i++){
        up=max(up,(ll)ceil(-bppi[i-1]*1.0/i)),down=min(down,(ll)floor(-bppi[i-1]*1.0/i));
        maxxc=max(maxxc,c[i]);
    }
    up+=maxxc;
    while(q--){
        int x;cin>>x;
        if(ans[x+MAXM]!=-1){
            cout<<ans[x+MAXM]<<endl;
            continue;
        }
        if(x<down){
            ll ans=1;
            for(int i=1;i<=n;i++)ans=ans*(c[i]+1)%Mod;
            cout<<ans<<endl;
            continue;
        }
        if(x>up){
            cout<<0<<endl;
            continue;
        }
        memset(dp,0,sizeof(dp));
        ll now=1,nex=0;
        for(int i=0;i<=c[1];i++)dp[1][i]=1;
        for(int i=1;i<=n;i++){
            memset(dp[nex],0,sizeof(dp[nex]));
            for(int j=max(0ll,x*i+bppi[i-1]);j<=cpi[i];j++){
                dp[nex][j]=(dp[nex][j]+dp[now][min(cpi[i-1],(ll)j)]+Mod)%Mod;
                if(j-c[i]-1>=0){
                    dp[nex][j]=(dp[nex][j]-dp[now][j-c[i]-1]+Mod)%Mod;
                }
            }
            for(int j=1;j<=cpi[i];j++)dp[nex][j]=(dp[nex][j]+dp[nex][j-1])%Mod;
            swap(nex,now);
        }
        ans[x+MAXM]=dp[now][cpi[n]];
        cout<<ans[x+MAXM]<<endl;
    }
    return 0;
}