#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> a;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a.push_back(x);
  }
  sort(a.begin(), a.end());
  vector<int> dp(k + 1, 0);
  vector<int> p(k + 1, 1);
  dp[0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= k; j++) {
      if (j == 0) {
        dp[j] = 1;
        p[j] = 1;
        continue;
      }
      if (j - (a[i] + 1) >= 0)
        dp[j] = max(p[j] - p[j - a[i] - 1], 0);
      else
        dp[j] = p[j];
      p[j] =
          ((dp[j] % (int)1e9 + 7) + (p[j - 1] % (int)1e9 + 7)) % (int)1e9 + 7;
    }
  }
  cout << dp[k];
}
