#include<stdio.h>
#include <iostream>
#include <math.h>
#include <numeric>
#include <vector>
#include <map>
#include <functional>
#include <stdio.h>
#include <array>
#include <algorithm>
#include <string>
#include <string.h>
#include <assert.h>
#include <stdio.h>
#include <queue>
#include<iomanip>
#include<bitset>
#include<stack>
#include<set>
#include<limits>
#include <complex>
using namespace std;

const int mod = 1000000007;
struct Mod {
public:
	int num;
	Mod() : num(0) { ; }
	Mod(long long int n) : num((n % mod + mod) % mod) { ; }
	Mod(int n) : num((n % mod + mod) % mod) { ; }
	operator int() { return num; }
};

Mod operator+(const Mod a, const Mod b) { return Mod((a.num + b.num) % mod); }
Mod operator+(const long long int a, const Mod b) { return Mod(a) + b; }
Mod operator++(Mod &a) { return a + Mod(1); }
Mod operator-(const Mod a, const Mod b) { return Mod((mod + a.num - b.num) % mod); }
Mod operator-(const long long int a, const Mod b) { return Mod(a) - b; }
Mod operator--(Mod &a) { return a - Mod(1); }
Mod operator*(const Mod a, const Mod b) { return Mod(((long long)a.num * b.num) % mod); }
Mod operator*(const long long int a, const Mod b) { return Mod(a)*b; }
Mod operator+=(Mod &a, const Mod b) { return a = a + b; }
Mod operator+=(long long int &a, const Mod b) { return a = a + b; }
Mod operator-=(Mod &a, const Mod b) { return a = a - b; }
Mod operator-=(long long int &a, const Mod b) { return a = a - b; }
Mod operator*=(Mod &a, const Mod b) { return a = a * b; }
Mod operator*=(long long int &a, const Mod b) { return a = a * b; }
Mod operator^(const Mod a, const int n) {
	if (n == 0) return Mod(1);
	Mod res = (a * a) ^ (n / 2);
	if (n % 2) res = res * a;
	return res;
}
Mod inv(const Mod a) { return a ^ (mod - 2); }
Mod operator/(const Mod a, const Mod b) {
	assert(b.num != 0);
	return a * inv(b);
}
Mod operator/(const long long int a, const Mod b) {
	assert(b.num != 0);
	return Mod(a) * inv(b);
}
Mod operator/=(Mod &a, const Mod b) {
	assert(b.num != 0);
	return a = a * inv(b);
}

#define MAX_N 1024000

Mod fact[MAX_N], factinv[MAX_N];
void init() {
	fact[0] = Mod(1); factinv[0] = 1;
	for (int i = 0; i < MAX_N - 1; ++i) {
		fact[i + 1] = fact[i] * Mod(i + 1);
		factinv[i + 1] = factinv[i] / Mod(i + 1);
	}
}
Mod comb(const int a, const int b) {
	return fact[a] * factinv[b] * factinv[a - b];
}
Mod dp[201][10001];
int main() {
	for (int i = 0; i < 201; ++i) {
		for (int j = 0; j < 10001; ++j) {
			dp[i][j] = Mod(0);
		}
	}
	dp[0][0] = Mod(1);

	int N, W; cin >> N >> W;
	vector<int>ws;
	for (int i = 0; i < N; ++i) {
		int w; cin >> w;
		ws.push_back(w);
	}
	sort(ws.begin(),ws.end());
	reverse(ws.begin(), ws.end());
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j <= W; ++j) {
			dp[i + 1][j] += dp[i][j];
			if (j + ws[i] <= W) {
				dp[i + 1][j + ws[i]] += dp[i][j];
			}
		}
	}
	if (W >= accumulate(ws.begin(), ws.end(), 0)||W<ws[N-1]) {
		cout << 1 << endl;
		return 0;
	}
	Mod ans(0);
	int needw = W;
	for (int i = 0; i < N; ++i) {
		if (i)
		{

			needw -= ws[N - i];
		}
		int from = max(0,needw - ws[N - i - 1]+1);
		//if (i == 0) {

		//}
		//else {
		//	from += ws[N - i - 1];
		//}
		for (int j=from; j <= needw; ++j) {
			ans += dp[N -i-1][j];
		}
	}

	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 19004