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