#include <bits/stdc++.h>
using namespace std;
long long int dp[101][100000];
long long int recur(long long int c, long long int b, long long int arr[]) {
  if (c < 0) {
    return 0;
  }
  if (b == 1) {
    if (arr[1] >= c) {
      dp[c][b] = 1;
      return 1;
    } else {
      dp[c][b] = 0;
      return 0;
    }
  }
  for (long long int i = 0; i <= b; i++) {
    dp[c][b] += recur(c - i, b - 1, arr);
  }
  return dp[c][b];
}
int main() {
  long long int n;
  cin >> n;
  long long int k;
  cin >> k;
  long long int arr[105] = {0};
  for (long long int i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  long long int rem = pow(10, 9) + 7;
  cout << (recur(k, n, arr)) % rem;
  return 0;
}
