#include <bits/stdc++.h>
using namespace std;
const int N = 100, N2 = 1e5, M = 1e9 + 7;
int dp[N2 + 1];
long long a[N];
long long n, x;
int main() {
  cin >> n >> x;
  for (int i = 0; i < n; ++i) cin >> a[i];
  dp[0] = 1;
  for (int i = 1; i <= n; ++i) {
    vector<int> pref_sum(x + 1, 0);
    pref_sum[0] = 1;
    for (int f = 1; f <= x; ++f) pref_sum[f] = (pref_sum[f - 1] + dp[f]) % M;
    for (int j = 1; j <= x; ++j) {
      if (a[i - 1] >= j)
        dp[j] = pref_sum[j];
      else
        dp[j] = (pref_sum[j] - pref_sum[j - a[i - 1] - 1]) % M;
    }
  }
  cout << dp[x] << "\n";
}
