Sunuke received a d-dimensional hypercube with a side length of l1 × ... × ld as a birthday present. Sunuke placed this rectangular parallelepiped so that the range of the i-th coordinate was 0 or more and li or less, and ate the part that satisfied x1 + ... + xd ≤ s. However, xi represents the i-th coordinate. If the volume of the part eaten by Sunuke is V, it can be proved that d! V (V multiplied by the factorial of d) is an integer. Find the remainder of d! V divided by 1,000,000,007.

Constraints

* 2 ≤ d ≤ 300
* 1 ≤ li ≤ 300
* 0 ≤ s ≤ $ \ sum l_ {i} $
* All inputs are integers

Input


d
l1
.. ..
ld
s


Output

Output d! V divided by 1,000,000,007.

Examples

Input

2
6
3
4


Output

15


Input

5
12
34
56
78
90
123


Output

433127538
#include <bits/stdc++.h>
using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef pair<LL, LL> PLL;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

int D;
int S;
LL dp[300+1][300*300+1][2];
int xs[300];
LL powm(LL x, LL y){
  if(y == 0) return 1;
  return powm(x*x%MOD, y/2) * (y%2?x:1) % MOD;
}

LL dfs(int i, int l, int b){
  if(l <= 0)
	return 0;
  if(dp[i][l][b])
	return dp[i][l][b];
  if(i == D){
	if(l == S) return 0;
	return dp[i][l][b] = (MOD + (b?1:-1) * powm(l,D)) % MOD;
  }

  return dp[i][l][b] = (dfs(i+1, l, b) + dfs(i+1, l-xs[i], b^1)) % MOD;
}

int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  cin >> D;
  REP(i,D) cin >> xs[i];
  cin >> S;

  /*
  LL ans = 0;
  for(int b=1;b<1<<D;++b){
	int num = 0, sum = 0;
	REP(i,D)
	  if(b>>i&1){
		++num;
		sum += xs[i];
	  }
	if(S <= sum) continue;
	if(num%2)
	  (ans += powm(S-sum, D)) %= MOD;
	else
	  (ans += MOD - powm(S-sum, D)) %= MOD;
  }
  cout << (MOD+powm(S,D) - ans)%MOD << endl;
  */
  cout << (MOD+powm(S,D) - dfs(0,S,0)) % MOD << endl;

  return 0;
}