#include <bits/stdc++.h>
using namespace std;

using ll = long long;

constexpr ll M = 1e9+7;

int main() {
    int N, W;
    cin >> N >> W;
    vector<int> w(N);
    ll sum = 0;
    for(int i=0; i<N; ++i) {
        cin >> w[i];
        sum += w[i];
    }
    if(sum <= W) {
        cout << 1 << endl;
        return 0;
    }
    sort(w.rbegin(), w.rend());
    vector<vector<ll>> dp(N+1, vector<ll>(W+1));
    dp[0][0] = 1;
    for(int i=0; i<N; ++i) {
        dp[i+1] = dp[i];
        for(int j=W-w[i]; j>=0; --j) {
            (dp[i+1][j+w[i]] += dp[i][j]) %= M;
        }
    }

    reverse(w.begin(), w.end());
    sum = 0;
    ll res = 0;
    for(int i=0; i<N; ++i) {
        for(int j=max(0LL, W-sum-w[i]+1); j <= W - sum - (i == 0 ? 0 : w[i-1]); ++j) {
            (res += dp[N-i][j]) %= M;
        }
        sum += w[i];
    }
    cout << res << endl;
}
