#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
const int mod = 1e9 + 7;
long long a[105], dp[maxn];
void dodaj(long long& a, long long b) {
  a += b;
  if (a >= mod) a -= mod;
  if (a <= -mod) a += mod;
}
int main() {
  long long n, k;
  cin >> n >> k;
  for (long long i = 0; i < n; i++) cin >> a[i];
  dp[0] = 1;
  for (long long i = 0; i < n; i++) {
    for (long long j = k; j >= 0; j--) {
      long long l = j + 1, r = j + min(a[i], k - j);
      for (long long o = l; o <= r; o++) dodaj(dp[o], dp[j]);
    }
  }
  cout << dp[k] << endl;
  return 0;
}
