#include <bits/stdc++.h>
using namespace std;
const int N = 101;
const int K = 1e5 + 1;
const int mod = 1e9 + 7;
int dp[N][K];
int n, k, a[N];
int add(int a, int b) { return (a + b) % mod; }
int main() {
  ios::sync_with_stdio(0);
  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 = k; j >= 0; j--) {
      for (int l = 0; l <= a[i]; l++) {
        if (j - l >= 0) dp[i][j] = add(dp[i][j], dp[i - 1][j - l]);
      }
    }
  }
  cout << dp[n][k] << endl;
}
