#include <bits/stdc++.h>
using namespace std;
int N, Q, b[105], c[105], q[105];
long long dp[2][105][4 * 105 * 105];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> N;
  for (int i = 0; i < N; ++i) cin >> c[i];
  for (int i = 0; i < N - 1; ++i) cin >> b[i];
  for (int i = 0; i <= c[N - 1]; ++i) {
    dp[(N - 1) & 1][i][100 * 200] = 1;
  }
  for (int i = N - 1; i > 0; --i) {
    memset(dp[(i - 1) & 1], 0, sizeof(dp[(i - 1) & 1]));
    for (int j = 0; j <= c[i]; ++j) {
      for (int k = -(N - i - 1) * 200; k <= (N - i - 1) * 200; ++k) {
        if (!dp[i & 1][j][100 * 200 + k]) continue;
        for (int x = 0; x <= c[i - 1]; ++x) {
          int nk = 100 * 200 + k + b[i - 1] - (j - x);
          dp[(i - 1) & 1][x][nk] += dp[i & 1][j][100 * 200 + k];
          if (dp[(i - 1) & 1][x][nk] >= 1000000007)
            dp[(i - 1) & 1][x][nk] -= 1000000007;
        }
      }
    }
  }
  cin >> Q;
  for (int i = 0; i < Q; ++i) cin >> q[i];
  long long ans = 0;
  for (int i = 0; i <= c[0]; ++i) {
    for (int j = 0; j <= 100 * 400; ++j) {
      long long cur = 2 * i - j + 100 * 200;
      if (cur >= 2 * q[0]) {
        ans += dp[0][i][j];
        if (ans >= 1000000007) ans -= 1000000007;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
