#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b, long long &x, long long &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  long long x1, y1;
  long long g = gcd(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return g;
}
long long C(long long int n, long long int r) {
  if (r > n) {
    return 0;
  }
  if (r > n - r) r = n - r;
  long long a = 1, b = 1;
  for (int i = 0; i < r; i++) {
    a = (a * (n - i)) % 1000000007;
    b = (b * (i + 1)) % 1000000007;
  }
  long long x, y;
  gcd(b, 1000000007, x, y);
  long long res = (a * (x % 1000000007 + 1000000007) % 1000000007) % 1000000007;
  return res;
}
int main() {
  long long int n, k;
  cin >> k >> n;
  long long int A[k];
  for (int i = 0; i < k; i++) {
    cin >> A[i];
  }
  long long int ans = 0;
  long long int a = n + k - 1;
  long long int b = k - 1;
  ans = (ans + C(a, b) % 1000000007) % 1000000007;
  for (int i = 0; i < k; i++) {
    ans = (ans - C(a - A[i] - 1, b) % 1000000007) % 1000000007;
  }
  cout << ans % 1000000007 << endl;
}
