
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ff              first
#define fo(i,n)         for(i=0;i<n;i++)
#define Fo(i,k,n)       for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define deb(x)          cout << #x << "=" << x << endl
#define deb2(x, y)      cout << #x << "=" << x << "," << #y << "=" << y << endl
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(x)            int x; cin>>x; while(x--)
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

const int N = 101, M = 1e5 + 1;
//=======================

// vi g[N];
int a[N];
int dp[N][M];

int rec_ans(int n, int w) {
	if (w < 0) return 0;
	if (dp[n][w] != -1) return dp[n][w];
	if (n == 0)
	{
		if (w == 0) return dp[n][w] = 1;
		else return dp[n][w] = 0;
	}
	int ans = 0;
	int i;
	fo(i, a[n - 1] + 1) {
		ans = ((ans % mod) + (rec_ans(n - 1, w - a[i]) % mod)) % mod;
	}
	return dp[n][w] = ans;
}


void solve() {
	int i, j, n, m;
	int k;
	cin >> n >> k;
	memset(dp, -1, sizeof(dp));
	fo(i, n) cin >> a[i];
	cout << rec_ans(n, k) << "\n";

}

int32_t main()
{
	FIO;
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	solve();
	return 0;
}
