#include<bits/stdc++.h>
#define endl '\n'
#define PI 3.14159265358979323844
#define DECIMAL(n)  std::cout << std::fixed;std::cout << std::setprecision(n);
#define mp make_pair
#define pb push_back
#define int long long int 
#define forr(i,a,b) for (int i= a; i <b; ++i)
    using namespace std; 
    int dp[200][100005];
int candy(int *a , int i, int e, int k ){
     if(i==0 && k<=a[0])return  1;
    if(i==0 && k>a[0])return 0;
    if(dp[i][k]!=-1)return dp[i][k];
    } return dp[i][k+1]=(candy(a,i,e,k)  + candy(a,i-1,e,k+1) - candy(a,i,e,k-a[i]))    %1000000007;
}

    
    signed main(){
        int n;cin>>n; int k;cin>>k;
        int a[n];forr(i,0,n) {cin>>a[i];}
        memset(dp,-1, sizeof dp);
        cout<< candy(a,n-1,0,k);
    }