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>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int n,m;
vi a;

int main(){
	cin>>n;
	a=vi(n);
	for(auto &i:a) cin>>i;
	cin>>m;
	vvl dp(2,vl(m+1));
	dp[0][m]++;
	for(int i=0;i<n;i++){
		for(int j=a[i];j<=m;j++) for(int k=0;k<2;k++) {
			(dp[k^1][j-a[i]]+=dp[k][j])%=mod;
		}
//		for(int j=0;j<=m;j++) cout<<dp[0][j]<<' '<<dp[1][j]<<endl;
//		cout<<endl;
	}
	ll res=0;
	for(int i=1;i<=m;i++){
		ll tmp=1;
		for(int j=0;j<n;j++) (tmp*=i)%=mod;
		for(int j=0;j<2;j++){
			ll t=dp[j][i]*tmp%mod;
			if(j==0) (res+=t)%=mod;
			else res=(res-t+mod)%mod;
		}
	}
	cout<<res<<endl;
}
