#include <bits/stdc++.h>
using namespace std;
const int ene = 120;
const int km = 1e5 + 10;
const int M = 1e9 + 7;
int t[ene];
int d[ene][km];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> t[i];
  d[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int m = 0; m <= k; m++) {
      for (int j = 0; j <= min(m, t[i]); j++) {
        d[i][m] += d[i - 1][m - j];
        d[i][m] = d[i][m] % M;
      }
    }
  }
  int wynik = d[n][k];
  cout << wynik;
  return 0;
}
