#include <bits/stdc++.h>
using namespace std;
vector<long long> numbers;
long long dp[105][100005];
long long mod = 1e9 + 7;
long long solve(int idx, long long left) {
  if (idx == numbers.size() && left == 0) {
    return 1;
  }
  if (idx == numbers.size()) {
    return 0;
  }
  if (dp[idx][left] != -1) {
    return dp[idx][left];
  } else {
    long long m = 0;
    for (int i = 0; i <= min(left, numbers[idx]); ++i) {
      m = (m % mod + solve(idx + 1, left - i) % mod) % mod;
    }
    return dp[idx][left] = m;
  }
}
int main() {
  long long n, k;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    long long e;
    cin >> e;
    numbers.push_back(e);
  }
  memset(dp, -1, sizeof(dp));
  cout << solve(0, k) << "\n";
  return 0;
}
