#include <bits/stdc++.h>
#pragma GCC optimuze("Ofast")
#pragma GCC optimuze("03")
#pragma GCC optimuze("unroll-loops")
using namespace std;
const int N = 1e5 + 5;
const int M = 2e2 + 5;
const int MOD = 1e9 + 7;
const int rx[] = {1, 0, -1, 0};
const int ry[] = {0, 1, 0, -1};
int dp[M][N];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  vector<int> a;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a.push_back(x);
  }
  dp[0][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= k; j++) {
      for (int z = 0; z <= a[i]; z++) {
        dp[i + 1][j + z] += dp[i][j];
        dp[i + 1][j + z] %= MOD;
      }
    }
  }
  cout << dp[n][k];
  return 0;
}
