#include <bits/stdc++.h>
using namespace std;
long long n;
long long dp[109][100009];
long long const mod = 1e9 + 7;
vector<long long> v(109);
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long k;
  cin >> n >> k;
  dp[0][k] = 1;
  for (long long i = 0; i < n; i++) {
    long long a;
    cin >> a;
    for (long long j = k; j >= 0; j--) {
      for (long long l = 0; l <= a; l++) {
        if (j - l < 0) continue;
        dp[i + 1][j - l] += dp[i][j];
        dp[i + 1][j - l] %= mod;
      }
    }
  }
  cout << dp[n][0] << endl;
}
