#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=1e4+5,mod=1e9+7;
int n,m,w[N],dp[N];
signed main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cin>>n>>m;
dp[0]=1;
for(int i=1;i<=n;i++)
{
cin>>w[i];
}
for(int i=1;i<=m;i++)
{
for(int j=1;j<=n;j++)
{
if(i<w[j])
{
continue;
}
dp[i]+=dp[i-w[j]];
dp[i]%=mod;
}
}
cout<<dp[m];
return 0;
}
/*
6 15
1 5 10 20 50 100
3 15
1 5 11
*/