#include <bits/stdc++.h>
using namespace std;
int ans[3000][3000];
long long int foo(long long int a[], int i, int j) {
  cout << i << " " << j << endl;
  if (j == (i + 1)) return max(a[i], a[j]);
  if (i == j) return a[i];
  if (ans[i][j] != (-1)) return ans[i][j];
  ans[i][j] = max(a[i] + min(foo(a, i + 1, j - 1), foo(a, i + 2, j)),
                  a[j] + min(foo(a, i, j - 2), foo(a, i + 1, j - 1)));
  return ans[i][j];
}
long long int prevs[100001], curr[100001];
int main() {
  memset(prevs, 0, sizeof(long long int));
  memset(curr, 0, sizeof(long long int));
  long long int n, k;
  cin >> n >> k;
  long long int a[n];
  for (long long int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (long long int i = 0; i <= k; i++) prevs[i] = 1;
  for (long long int i = 0; i < n; i++) {
    curr[0] = 1;
    for (long long int j = 1; j <= a[i]; j++) curr[j] = prevs[j] + curr[j - 1];
    for (long long int p = a[i] + 1; p <= k; p++) {
      long long int x = p - a[i] - 1;
      x = prevs[p] - prevs[x];
      curr[p] = curr[p - 1] + x;
    }
  }
  cout << (prevs[k] - prevs[k - 1]) % 1000000007 << endl;
}
