#include<iostream>
using namespace std;
using ll = long long;
ll dp[101][101], n, m;
int temp;
int main()
{
cin >> n >> m;
dp[0][0] = 1;
for (int i = 1; i <= n; i++) {
cin >> temp;
for (int j = 1; j <= m; j++) {
for (int t = 0; t <= temp&&t<=j; t++) {
dp[i][j] += dp[i - 1][j - t];
}
}
}
cout << dp[n][m]%1000007 << endl;
return 0;
}