#include <bits/stdc++.h>
using namespace std;
const int mxN = 1e2 + 3, mxK = 1e5 + 3, MOD = 1e9 + 7;
int n, k, candies[mxN];
int dp[mxN][mxK];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> candies[i];
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int c = 0; c <= k; c++) {
      int ret = 0;
      for (int use = 0; use <= candies[i]; use++) {
        if (c - use >= 0) {
          ret += dp[i - 1][c - use];
          ret %= MOD;
        }
      }
      dp[i][c] = ret;
    }
  }
  cout << dp[n][k];
}
