#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define INF INT_MAX
#define F first
#define S second
#define ld long double
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpii vector<pii>
#define rep(i,n) for(i=0;i<n;i++)
#define repr(i,n) for(i=n-1;i>=0;i--)
#define o4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl;
#define initial(arr,val) memset(arr,val,sizeof(arr))
#define value(x) cout << #x << " is " << x << endl;
const int dx[8] = {-1, 0, 0, 1, 1, 1, -1, -1};
const int dy[8] = { 0, -1, 1, 0, -1, 1, -1, 1};
const int N=101,X=1e6+2;
int dp[X+1][N+1];
int c[N+1];
void solve(){
int n,x;
cin>>n>>x;
for(int i=0;i<n;i++)
cin>>c[i];
for(int i=0;i<n;i++){
for(int j=0;j<=x;j++){
if(j==0)
dp[j][i]=1;
else{
int op1=(i>=1) ? dp[j][i-1]:0;
int op2=(j>=c[i])? dp[j-c[i]][i]:0;
dp[j][i]=(op1+op2)%mod;
}
}
}
cout<<dp[x][n-1];
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int tc = 1;
//cin >> tc;
for(int k = 1 ;k <= tc; k++){
// cout<<"Case #"<<k<<": ";
solve();
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgcGIgcHVzaF9iYWNrCiNkZWZpbmUgbXAgbWFrZV9wYWlyCiNkZWZpbmUgbW9kIDEwMDAwMDAwMDcKI2RlZmluZSBJTkYgIElOVF9NQVgKI2RlZmluZSBGIGZpcnN0CiNkZWZpbmUgUyBzZWNvbmQKI2RlZmluZSBsZCBsb25nIGRvdWJsZQojZGVmaW5lIGxsIGxvbmcgbG9uZwojZGVmaW5lIHBpaSBwYWlyPGludCxpbnQ+CiNkZWZpbmUgcGxsIHBhaXI8bGwsbGw+CiNkZWZpbmUgdnBpaSB2ZWN0b3I8cGlpPgojZGVmaW5lIHJlcChpLG4pIGZvcihpPTA7aTxuO2krKykKI2RlZmluZSByZXByKGksbikgZm9yKGk9bi0xO2k+PTA7aS0tKQojZGVmaW5lIG80KGEsYixjLGQpIGNvdXQ8PChhKTw8IiAiPDwoYik8PCIgIjw8KGMpPDwiICI8PChkKTw8ZW5kbDsKI2RlZmluZSBpbml0aWFsKGFycix2YWwpIG1lbXNldChhcnIsdmFsLHNpemVvZihhcnIpKQojZGVmaW5lIHZhbHVlKHgpIGNvdXQgPDwgI3ggPDwgIiBpcyAiIDw8IHggPDwgZW5kbDsKY29uc3QgaW50IGR4WzhdID0gey0xLCAwLCAwLCAxLCAxLCAxLCAtMSwgLTF9Owpjb25zdCBpbnQgZHlbOF0gPSB7IDAsIC0xLCAxLCAwLCAtMSwgMSwgLTEsIDF9Owpjb25zdCBpbnQgTj0xMDEsWD0xZTYrMjsKaW50IGRwW1grMV1bTisxXTsKaW50IGNbTisxXTsKdm9pZCBzb2x2ZSgpewogICAgaW50IG4seDsKICAgIGNpbj4+bj4+eDsKICAgIGZvcihpbnQgaT0wO2k8bjtpKyspCiAgICAgICAgY2luPj5jW2ldOwogICAgZm9yKGludCBpPTA7aTxuO2krKyl7CiAgICAgICAgZm9yKGludCBqPTA7ajw9eDtqKyspewogICAgICAgICAgICAgICAgaWYoaj09MCkKICAgICAgICAgICAgICAgIGRwW2pdW2ldPTE7CiAgICAgICAgICAgICAgIGVsc2V7CiAgICAgICAgICAgICAgICAgIGludCBvcDE9KGk+PTEpID8gZHBbal1baS0xXTowOwogICAgICAgICAgICAgICAgICBpbnQgb3AyPShqPj1jW2ldKT8gZHBbai1jW2ldXVtpXTowOwogICAgICAgICAgICAgICAgZHBbal1baV09KG9wMStvcDIpJW1vZDsKICAgICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICB9CiAgICAgIGNvdXQ8PGRwW3hdW24tMV07CgoKfQppbnQgbWFpbigpCnsKICAgIGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpOwogICAgY2luLnRpZSgwKTsKICAgIGNvdXQudGllKDApOwogICAgaW50IHRjID0gMTsKICAgIC8vY2luID4+IHRjOwogICAgZm9yKGludCBrID0gMSA7ayA8PSB0YzsgaysrKXsKICAgICAgIC8vIGNvdXQ8PCJDYXNlICMiPDxrPDwiOiAiOwogICAgICAgIHNvbHZlKCk7CgogICAgfQogICAgcmV0dXJuIDA7Cn0K