#include <bits/stdc++.h>
using namespace std;
long long n, k;
long long a[101];
vector<vector<long long>> dp(101, vector<long long>(10001, -1));
long long distribute(long long k, long long ind) {
  if (ind == n) {
    return (k == 0);
  }
  if (dp[ind][k] != -1) {
    return dp[ind][k];
  }
  long long ways = 0;
  for (long long i = 0; i <= min(k, a[ind]); i++) {
    ways = (ways + distribute(k - i, ind + 1)) % 1000000007;
  }
  return dp[ind][k] = ways;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  cout << distribute(k, 0) << '\n';
  return 0;
}
