#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
//#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
//#include<list>
#include<queue>
#include<deque>
#include<algorithm>
//#include<numeric>
#include<utility>
//#include<memory>
#include<functional>
#include<cassert>
#include<set>
#include<stack>
#include<random>

const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, -1, 0, 1};
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;

const int INF = 1e9;
const int MOD = 1e9+7;
const int MAXW = 10010;

ll dp[MAXW];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, W;
    cin >> N >> W;
    vector<int> w(N+1);
    for (int i = 0; i < N; i++)
        cin >> w[i];
    w[N] = INF;
    sort(w.begin(), w.end());
    ll ans = 0;
    // [0, i) ????????¨?????? i ????????¨????????????????????´????????°
    for (int i = 0; i <= N; i++) {
        memset(dp, 0, sizeof(dp));
        int sum = 0;
        for (int j = 0; j < i; j++)
            sum += w[j];
        dp[0] = 1;
        for (int j = i+1; j < N; j++) {
            for (int k = MAXW-1; k >= 0; k--) if (dp[k]) {
                if (k+w[j] <= W-sum) (dp[k+w[j]] += dp[k]) %= MOD;
            }
        }
        for (int j = max(0, W-sum-w[i]+1); j <= W-sum; j++) if (dp[j]) {
            (ans += dp[j]) %= MOD;
        }
    }
    cout << ans << endl;
    return 0;
}