#include <bits/stdc++.h>
using namespace std;
long long binpow(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
long long binpowmod(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long mod_inverse(long long n, long long p) {
  return binpowmod(n, p - 2, p);
}
unsigned long long gcd(unsigned long long x, unsigned long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
bool comp(pair<long long, long long> x, pair<long long, long long> y) {
  return x.first > y.first;
}
bool comp_pairs_by_s(pair<long long, long long> &x,
                     pair<long long, long long> &y) {
  return x.second < y.second;
}
bool isPowerOfTwo(long long x) { return x && (!(x & (x - 1))); }
class cmp {
 public:
  bool operator()(pair<int, int> A, pair<int, int> B) {
    if (abs(A.first - A.second) == abs(B.first - B.second))
      return A.first > B.first;
    return abs(A.first - A.second) < abs(B.first - B.second);
  }
};
void swap(int &x, int &y) {
  int temp = x;
  x = y;
  y = temp;
}
long long dp[100005][104];
long long pref[100005][104];
void solve() {
  int n, k;
  cin >> n >> k;
  vector<long long> a(n);
  for (auto &it : a) cin >> it;
  sort(a.begin(), a.end(), greater<long long>());
  for (int i = 0; i <= n; i++) {
    dp[0][i] = 1;
    pref[1][i] = 1;
  }
  for (int i = 1; i <= k; i++) dp[i][0] = 0;
  for (int i = 1; i <= k; i++) {
    for (int j = 1; j <= n; j++) {
      dp[i][j] = (pref[i][j - 1] - pref[max(0LL, i - a[j - 1])][j - 1] +
                  dp[i][j - 1]) %
                 1000000007;
      pref[i + 1][j - 1] = (dp[i][j - 1] + pref[i][j - 1]) % 1000000007;
      pref[i + 1][j] = (dp[i][j] + pref[i][j]) % 1000000007;
    }
  }
  cout << dp[k][n];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
}
