#include <bits/stdc++.h>
const int M = 998244353;
using namespace std;
const long long int mod = 1e9 + 7;
const long long int N = 3e5 + 7;
long long int n, k, a[109], sum;
long long int dp[N][109];
long long int solve(long long int sum, long long int idx) {
  if (idx == n) {
    if (sum != k) return 0;
    if (sum == k) {
      return 1;
    }
  }
  if (dp[sum][idx] != -1) return dp[sum][idx];
  long long int x = 0;
  for (long long int i = 0; i <= a[idx]; i++) {
    x += solve(sum + i, idx + 1);
  }
  dp[sum][idx] = (x) % mod;
  return x % mod;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> k;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  memset(dp, -1, sizeof(dp));
  cout << solve(0, 0);
}
