#include <bits/stdc++.h>
using namespace std;
int n, k;
const int MAXN = 100000 + 100;
int a[MAXN];
const int mod = 1000000007;
long long dp[110][MAXN];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= k; j++) {
      for (int l = 0; l <= a[i]; l++) {
        if (j >= l) {
          dp[i][j] += dp[i - 1][j - l];
          dp[i][j] %= mod;
        }
      }
    }
  }
  cout << dp[n][k];
  return 0;
}
