#include#include #include using namespace std;int n,m,a[105],dp[105][105];const int MOD=1000007;int main(){ scanf("%d%d",&n,&m); dp[0][0]=1; for(int i=1;i<=n;i++){ scanf("%d",&a[i]); for(int j=0;j<=m;j++){ for(int k=0;k<=j&&k<=a[i];k++){ dp[i][j]+=dp[i-1][j-k]; dp[i][j]%=1000007; } } } printf("%d\n",dp[n][m]);}