#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
#define BIG_NUM 2000000000
#define MOD 1000000007
using namespace std;

int main(){

    int N,W,ans = 0,sum = 0;
    scanf("%d %d",&N,&W);

    int* dp = new int[W+1];
    int* friends = new int[N+1];

    friends[0] = 0;
    for(int i = 1; i <= N; i++){
        scanf("%d",&friends[i]);
        sum += friends[i];
    }

    sort(friends,friends+(N+1));

    if(sum <= W || W < friends[1]){
        printf("1\n");
        return 0;
    }

    sum = 0;
    for(int i = 1; i <= N; i++){
        sum += friends[i-1];
        if(sum > W)break;

        if(i == N){
            ans = (ans + 1)%MOD;
            break;
        }

        for(int a = 0; a <= W-sum; a++)dp[a] = 0;

        dp[0] = 1;

        for(int a = i+1; a <= N; a++){
            for(int b = W-sum; b >= friends[a]; b--){
                dp[b] = (dp[b] + dp[b-friends[a]])%MOD;
            }
        }

        for(int a = 0; a <= W-sum; a++){
            if(W-sum-a < friends[i]){
                ans = (ans + dp[a])%MOD;
            }
        }
    }

    printf("%d\n",ans%MOD);

    return 0;
}