#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

int dp[101][100001];
int a[200];

int main(){
	int n,K;scanf("%d%d",&n,&K);
	rep(i,n)scanf("%d",&a[i]);
	dp[0][0]=1;
	rep(i,n){
		int sum=0;
		for(int j=0;j<=K;j++){
			(sum+=dp[i][j])%=MOD;
			dp[i+1][j]=sum;
			if(j>=a[i]){
				sum=(sum+MOD-dp[i][j-a[i]])%MOD;
			}
		}
	}
	cout<<dp[n][K]<<endl;
}