#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
const long long N = 1e5 + 5;
long long dp[105][N];
long long n, x;
long long a[N];
long long solve(long long s, long long i) {
  if (s == x && i == n) {
    return 1;
  } else if (s != x && i == n)
    return 0;
  if (dp[i][s] != -1) return dp[i][s];
  long long ans = 0;
  for (long long j = 0; j <= a[i]; ++j) {
    ans += solve(s + j, i + 1);
  }
  return dp[i][s] = ans % mod;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> x;
  memset(dp, -1, sizeof(dp));
  for (long long i = 0; i < n; ++i) cin >> a[i];
  cout << solve(0, 0) << "\n";
}
