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