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 ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(a,b) for(auto (a): (b))
#define all(v) (v).begin(),(v).end()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define svec(v) cout<<#v<<":";rep(kbrni,v.size())cout<<" "<<v[kbrni];cout<<endl
#define sset(s) cout<<#s<<":";each(kbrni,s)cout<<" "<<kbrni;cout<<endl
#define smap(m) cout<<#m<<":";each(kbrni,m)cout<<" {"<<kbrni.first<<":"<<kbrni.second<<"}";cout<<endl

using namespace std;

typedef pair<int,int>P;

int dp[301][90001][2];

ll mod_pow(ll a,ll b)
{
    a %= MOD;
    ll res = 1;
    while(b){
        if(b & 1){
            res = res * a % MOD;
        }
        a = a * a %MOD;
        b >>= 1;
    }
    return res;
}

ll add(ll x,ll y)
{
    return (x + y)%MOD;
}

ll sub(ll x,ll y)
{
    return (x+MOD-y)%MOD;
}

ll mult(ll x,ll y)
{
    return x*y%MOD;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int d;
    cin >> d;
    vector<int> l(d);
    rep(i,d){
        cin >> l[i];
    }
    int s;
    cin >> s;
    dp[0][s][0] = 1;
    rep(i,d){
        rep(j,s+1){
            if(j >= l[i]){
                dp[i+1][j-l[i]][1] = add(dp[i+1][j-l[i]][1],dp[i][j][0]);
                dp[i+1][j-l[i]][0] = add(dp[i+1][j-l[i]][0],dp[i][j][1]);
            }
            dp[i+1][j][0] = add(dp[i+1][j][0],dp[i][j][0]);
            dp[i+1][j][1] = add(dp[i+1][j][1],dp[i][j][1]);
        }
    }
    ll ans = 0;
    for(int i=1;i<=s;i++){
        ans = add(ans,mult(mod_pow(i,d),sub(dp[d][i][0],dp[d][i][1])));
    }
    cout << ans << endl;
    return 0;
}