#include<bits/stdc++.h>
using namespace std;
#define int long long
int MOD = 1000000007;
signed main() {

	int N, W;
	cin >> N >> W;
	vector<int> w(N + 1);
	w[0] = 1000000;
	for (int i = 0; i < N; i++) {
		cin >> w[i + 1];
	}
	sort(w.begin(), w.end());
	reverse(w.begin(), w.end());
	vector<vector<int> > dp(N + 1, vector<int>(W + 1, 0));
	vector<vector<int> > ndp(N + 1, vector<int>(W + 1, 0));
	dp[0][0] = 1;
	for (int i = 1; i <= N; i++) {
		for (int j = 0; j <= i; j++) {
			for (int k = 0; k <= W; k++) {
				ndp[j][k] = 0;
			}
		}
		for (int j = 0; j < i; j++) {
			for (int k = 0; k <= W; k++) {
				if (k + w[i] <= W) {
					ndp[j][k + w[i]] = (ndp[j][k + w[i]] + dp[j][k]) % MOD;
				}
				ndp[i][k] = (ndp[i][k] + dp[j][k]) % MOD;
			}
		}
		swap(dp, ndp);
	}
	int res = 0;
	for (int i = 0; i <= N; i++) {
		for (int j = max((int)0, W - w[i] + 1); j <= W; j++) {
			res = (res + dp[i][j]) % MOD;
		}
	}
	cout << res << endl;
}
