#include <bits/stdc++.h>
using namespace std;
long long dp[101][100001];
int a[101];
long long way(int n, int k, long long sum) {
  if (sum < k) return 0;
  if (n == 0) return (k == 0);
  if (k == 0) return 1;
  if (dp[n][k] != -1) return dp[n][k];
  long long ans = 0;
  for (int i = 0; i <= a[n]; i++) {
    if (k >= i) ans = (ans + way(n - 1, k - i, sum - a[n])) % 1000000007;
  }
  return dp[n][k] = ans;
}
int main() {
  long long n, k;
  cin >> n >> k;
  long long sum = 0;
  for (int i = 1; i <= n; i++) cin >> a[i], sum += a[i];
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= k; j++) {
      dp[i][j] = -1;
    }
  }
  cout << way(n, k, sum) << endl;
  return 0;
}
