/*********************/
//Hard work beats talent when talent doesn’t work hard
/*********************/
#include <iostream>
using namespace std;
#include<bits/stdc++.h>
/*#define int long long*/
#define wh while (t--)
#define pb push_back
#define popcount __builtin_popcountll
#define beg begin()
#define endi end()
#define f first
#define sec second
#define endl '\n'
#define iso ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int mod = 1e9+7;
int arr[(int)1e3+4] ;
int n ;
int x ;
int memo[(int)1e6+5][100+2] ;
int solve(int sum ,int index )
{
if(sum==0)
{
return 1 ;
}
if(sum<0)
{
return 0 ;
}
if(index>=n)
{
return 0 ;
}
if(memo[sum][index]!=-1)
return memo[sum][index]%mod ;
int take =solve(sum-arr[index],index)%mod ;
int no_take =solve(sum,index+1)%mod ;
int ans =(take+no_take)%mod;
return memo[sum][index]=ans%mod ;
}
int32_t main() {
iso ;
memset(memo ,-1 ,sizeof(memo)) ;
cin>> n >>x ;
for(int i=0 ;i<n ;i++)
{
cin>> arr[i] ;
}
cout<<solve(x,0) ;
}
LyoqKioqKioqKioqKioqKioqKioqKi8KLy9IYXJkIHdvcmsgYmVhdHMgdGFsZW50IHdoZW4gdGFsZW50IGRvZXNu4oCZdCB3b3JrIGhhcmQKLyoqKioqKioqKioqKioqKioqKioqKi8KI2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwojaW5jbHVkZTxiaXRzL3N0ZGMrKy5oPgovKiNkZWZpbmUgaW50IGxvbmcgbG9uZyovCiNkZWZpbmUgd2ggd2hpbGUgKHQtLSkKI2RlZmluZSBwYiBwdXNoX2JhY2sKI2RlZmluZSAgcG9wY291bnQgX19idWlsdGluX3BvcGNvdW50bGwKI2RlZmluZSBiZWcgYmVnaW4oKQojZGVmaW5lIGVuZGkgZW5kKCkKI2RlZmluZSBmIGZpcnN0CiNkZWZpbmUgc2VjIHNlY29uZAojZGVmaW5lIGVuZGwgJ1xuJwojZGVmaW5lIGlzbyBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKGZhbHNlKTtjaW4udGllKDApO2NvdXQudGllKDApOwppbnQgbW9kID0gMWU5Kzc7CmludCBhcnJbKGludCkxZTMrNF0gOwppbnQgbiA7CmludCB4IDsKaW50IG1lbW9bKGludCkxZTYrNV1bMTAwKzJdIDsKaW50IHNvbHZlKGludCBzdW0gLGludCBpbmRleCApCnsKIAogICAgaWYoc3VtPT0wKQogICAgewogICAgICAgIHJldHVybiAxIDsKICAgIH0KICAgIGlmKHN1bTwwKQogICAgewogICAgICAgIHJldHVybiAwIDsKICAgIH0KICAgIGlmKGluZGV4Pj1uKQogICAgewogICAgICAgIHJldHVybiAwIDsKIAogICAgfQogaWYobWVtb1tzdW1dW2luZGV4XSE9LTEpCiAgICByZXR1cm4gbWVtb1tzdW1dW2luZGV4XSVtb2QgIDsKIGludCB0YWtlID1zb2x2ZShzdW0tYXJyW2luZGV4XSxpbmRleCklbW9kIDsKIGludCBub190YWtlID1zb2x2ZShzdW0saW5kZXgrMSklbW9kIDsKIGludCBhbnMgPSh0YWtlK25vX3Rha2UpJW1vZDsKIHJldHVybiBtZW1vW3N1bV1baW5kZXhdPWFucyVtb2QgOwogCiAKfQppbnQzMl90IG1haW4oKSB7CmlzbyA7Cm1lbXNldChtZW1vICwtMSAsc2l6ZW9mKG1lbW8pKSA7CmNpbj4+IG4gPj54IDsKZm9yKGludCBpPTAgO2k8biA7aSsrKQp7CiAgICBjaW4+PiBhcnJbaV0gOwp9CmNvdXQ8PHNvbHZlKHgsMCkgOwogCiAKfQ==