#include <bits/stdc++.h>
using namespace std;
int n;
int a[100];
vector<vector<long long>> dp(100, vector<long long>(1e5 + 1, -1));
const int mod = 1e9 + 7;
long long fun1(int x) {
  long long t = 1;
  while (x) {
    t *= x;
    t %= mod;
    --x;
  }
  long long res = 1;
  int m = mod - 2;
  while (m) {
    if (m & 1) res = (res * t) % mod;
    t = (t * t) % mod;
    m >>= 1;
  }
  return res;
}
long long fun(int x, int k) {
  if (dp[x][k] != -1) return dp[x][k];
  if (x == n - 1) {
    if (k > a[x])
      return dp[x][k] == 0;
    else
      return dp[x][k] = 1;
  }
  long long t = 0;
  if (a[x] >= k) {
    int t1 = n - x - 1;
    long long t2 = 1, t3 = fun1(t1);
    while (t1) {
      t2 *= (k + t1);
      t2 %= mod;
      --t1;
    }
    return dp[x][k] = (t2 * t3) % mod;
  }
  for (int i = 0; i <= min(a[x], k); ++i) {
    t += fun(x + 1, k - i);
    t %= mod;
  }
  return dp[x][k] = t;
}
int main() {
  int k;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  cout << fun(0, k);
}
