#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 100 + 5;
const int K = 1e5 + 5;
const int MOD = 1e9 + 7;
ll dp[N][K];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  vector<int> a(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= k; j++) {
      for (int give = 0; give <= min(a[i], j); give++) {
        (dp[i][j] += dp[i - 1][j - give]) %= MOD;
      }
    }
  }
  cout << dp[n][k] << '\n';
}
