#include <bits/stdc++.h>
using namespace std;
vector<int> a;
vector<vector<long long>> dp;
long long solve(int i, int k) {
  if (k == 0) return 1;
  if (k < 0) return 0;
  if (i < 0) return 0;
  if (dp[i][k] != -1) return dp[i][k];
  long long ans = 0LL;
  for (int j = 0; j <= a[i]; j++) {
    ans += solve(i - 1, k - j);
    ans %= 1000000007;
  }
  dp[i][k] = ans;
  return dp[i][k];
}
int main() {
  int n, k;
  cin >> n >> k;
  a.resize(n, 0);
  dp.resize(n, vector<long long>(k + 1, 0));
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  for (int i = 0; i <= a[0]; i++) dp[0][i] = 1LL;
  for (int i = 0; i < n; i++) dp[i][0] = 1LL;
  for (int i = 1; i < n; i++) {
    for (int j = 1; j <= k; j++) {
      if (j <= a[i]) {
        dp[i][j] += dp[i - 1][j] + (dp[i][j - 1]);
        dp[i][j] %= 1000000007;
      }
    }
  }
  cout << dp[n - 1][k] << "\n";
  return 0;
}
