#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
	int N, W; cin >> N >> W;
	vector<int> w(N);
	for (int i = 0; i < N; i++) cin >> w[i];
	sort(w.begin(), w.end());
	w.push_back(10001);
	ll ans = 0;
	for (int i = 0; i <= N; i++) {
		int sum = 0;
		for (int j = 0; j < i; j++) sum += w[j];
		if (sum > W) continue;
		vector<ll> dp(W + 1);
		dp[sum] = 1;
		for (int j = i + 1; j <= N; j++)
			for (int k = W; k >= w[j]; k--)
				dp[k] = (dp[k] + dp[k - w[j]]) % MOD;
		for (int k = max(0, W - w[i] + 1); k <= W; k++)
			ans = (ans + dp[k]) % MOD;
	}
	cout << ans << endl;
}