#include <bits/stdc++.h>
using namespace std;
const int C = 110001, D = 101, M = 1000000007;
int n, a[D], i, j, k;
long long dp[2][C], wynn = 0, fac[C], af[C];
inline long long cn(int n, int k) {
  return (((fac[n] * af[k]) % M) * af[n - k]) % M;
}
inline long long pow(long long a, long long b, long long M) {
  if (b == 0) return 1;
  long long c = 1;
  while (b > 0) {
    if (b % 2 == 1) c = (c * a) % M;
    b /= 2;
    a = (a * a) % M;
  }
  return c;
}
int main() {
  fac[0] = 1, af[0] = 1;
  for (i = 1; i < C; i++)
    fac[i] = (fac[i - 1] * i) % M, af[i] = pow(fac[i], M - 2, M);
  dp[0][0] = 1;
  scanf("%d %d", &n, &k);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    a[i]++;
    for (j = k; j >= a[i]; j--) {
      dp[0][j] = (dp[0][j] + dp[1][j - a[i]]) % M;
      dp[1][j] = (dp[1][j] + dp[0][j - a[i]]) % M;
    }
  }
  for (i = 0; i <= k; i++) {
    wynn = (wynn + dp[0][i] * cn(k - i + n - 1, n - 1)) % M;
    wynn = (wynn - dp[1][i] * cn(k - i + n - 1, n - 1)) % M;
  }
  printf("%lld", wynn);
  return 0;
}
