#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 5;
const long long MOD = 1e9 + 7;
long long a[MAX], p[MAX][105];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  long long sum = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    sum += a[i];
  }
  if (sum < k) {
    cout << 0 << '\n';
    return 0;
  } else if (sum == k) {
    cout << 1 << '\n';
    return 0;
  }
  sort(a, a + n);
  memset(p, 0, sizeof(p));
  for (int r = 0; r <= a[0]; ++r) {
    p[r][0] = 1;
  }
  for (int c = 1; c < n; ++c) {
    p[0][c] = 1;
    for (int r = 1; r <= a[c]; ++r) {
      p[r][c] = (p[r][c - 1] + p[r - 1][c]) % MOD;
    }
  }
  cout << p[a[n - 1]][n - 1] << '\n';
  return 0;
}
