#include <bits/stdc++.h>
using namespace std;
long long MAX = 1e9;
long long MAXEST = 1e18;
long long MOD = 1e9 + 7;
long long n, k;
long long a[105];
long long dp[105][100005];
long long f(long long idx, long long rem) {
  if (idx == n) {
    return (rem == 0);
  }
  long long &ret = dp[idx][rem];
  if (ret != -1) return ret;
  ret = 0;
  for (long long i = 0; i <= a[idx]; i++) {
    if (rem - i >= 0) {
      ret += f(idx + 1, rem - i);
      ret %= MOD;
    }
  }
  return ret % MOD;
}
long long main() {
  long long tc = 1;
  while (tc--) {
    cin >> n >> k;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
    }
    memset(dp, -1, sizeof dp);
    cout << f(0, k) % MOD << endl;
  }
  return 0;
}
