#include <bits/stdc++.h>
using namespace std;
void fileIO() {}
bool sortbysecdesc(const pair<long long, long long> &a,
                   const pair<long long, long long> &b) {
  return a.second > b.second;
}
long long countWays(vector<long long> a, long long n, long long k,
                    vector<vector<long long>> &dp) {
  long long &ans = dp[n][k];
  if (ans != -1) return ans;
  if (k == 0)
    ans = 1;
  else if (n == 0)
    ans = 0;
  else {
    long long ways = 0;
    for (long long i = 0; i <= min(a[n - 1], k); i++) {
      ways = (ways % 1000000007 + countWays(a, n - 1, k - i, dp) % 1000000007) %
             1000000007;
    }
    ans = ways % 1000000007;
  }
  return ans;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  fileIO();
  long long T;
  T = 1;
  while (T--) {
    long long n, k;
    cin >> n >> k;
    vector<long long> a(n);
    for (long long i = 0; i < n; i++) cin >> a[i];
    vector<vector<long long>> dp(n + 1, vector<long long>(k + 1, -1));
    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());
    cout << countWays(a, n, k, dp) << "\n";
  }
  return 0;
}
