// ਅਗਮਜੋਤ ਸਿੰਘ
// AGAMJOT SINGH

#include <bits/stdc++.h>
using namespace std; 
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define int long long int
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

// a_gamer

int power(int x, unsigned int y, int p) { 
    int res = 1;      // Initialize result 
  
    x = x % p;  // Update x if it is more than or  
                // equal to p 
  
    while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res*x) % p; 
  
        // y must be even now 
        y = y>>1; // y = y/2 
        x = (x*x) % p;   
    } 
    return res; 
} 
  
int max(int a, int b){
    if (a > b)
        return a;
    else
        return b;
}
int maxSubArraySum(vector<int> &v){
    int size = v.size();
    int max_so_far = 0, max_ending_here = 0;
    int a[size];
    for (int i = 0; i < size; i++)
    {
        a[i] = v[i];
    }
    for (int i = 0; i < size; i++)
    {
        max_ending_here = max_ending_here + a[i];
        if (max_ending_here < 0)
            max_ending_here = 0;
        else if (max_so_far < max_ending_here)
            max_so_far = max_ending_here;
    }
    return max_so_far;
}
int NcR(int n, int r) { 
   
    long long p = 1, k = 1;  
    if (n - r < r) 
        r = n - r;  
    if (r != 0) {   
        while (r) { 
            p *= n; 
            k *= r;  
            long long m = __gcd(p, k);  
            p /= m; 
            k /= m;  
            n--; 
            r--; 
        }  
    }  
    else
        p = 1;  
    return p; 
}
int dp[101][100000+1],till[101][100000+1];
signed main(){ 
    fastio;
    int n ,k;
    cin >> n >> k;
    vector<int>v(n);
    for(int i=0;i<n;i++){
        cin >> v[i];
    }
    sort(v.begin(),v.end());
    // unordered_map<int,int>dp[n],till[n];
    int ans = 0;
    for(int i=0;i<n;i++){
        dp[i][0] = 1;
        till[i][0] = 1;
    }
    for(int i=1;i<=k;i++){  
        // have to make sum i at every index of array
        for(int j=0;j<n;j++){ 
            if(j == 0){
                if(v[j] >= i)
                    dp[j][i] = 1;
                else{
                    dp[j][i] = 0;
                }
                if(i-1 < 0){
                    cout << "&&\n";
                    continue;
                }
                till[j][i] = (till[j][i] + (till[j][i-1] + dp[j][i]))%mod; 
                continue;
            }  
            if(i-1 < 0){
                cout << "&&\n";
                continue;
            }
            // have to take every possible number that arr[i] can take
            dp[j][i] = (dp[j][i] +  (till[j-1][i] - till[j-1][i-v[j]-1] ))%mod;
            till[j][i] = (till[j][i] + (till[j][i-1] + dp[j][i]))%mod;   
        }
    }
    ans = dp[n-1][k]%mod;
    cout << ans%mod << "\n";
}
