#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
long long dp[100 + 5][100000 + 5];
long long a[100 + 5];
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k;
  cin >> n >> k;
  for (long long i = 0; i < n; i += 1) cin >> a[i];
  sort(a, a + n);
  if (k == 0 && a[n - 1] != 0) {
    cout << 0;
    return 0;
  }
  if (k == 0 && a[n - 1] == 0) {
    cout << 1;
    return 0;
  }
  for (long long i = 0; i < k + 1; i += 1) {
    for (long long j = 0; j < n; j += 1) {
      if (i == 0)
        dp[j][0] = 1;
      else if (j == 0) {
        if (a[0] >= i)
          dp[j][i] = (dp[j][i - 1] + 1) % 1000000007;
        else
          dp[j][i] = dp[j][i - 1];
      } else {
        long long ind = 0;
        if (i > a[j]) ind = i - a[j];
        dp[j][i] = (dp[j - 1][i] + dp[j][i - 1]) % 1000000007;
        if (ind) dp[j][i] = (dp[j][i] - dp[j - 1][ind - 1]) % 1000000007;
      }
    }
  }
  cout << (dp[n - 1][k] - dp[n - 1][k - 1]) % 1000000007 << "\n";
}
