#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  long int dp[n][k + 1];
  for (int i = 0; i < n; i++) dp[i][0] = 1;
  vector<int> c(n);
  int i, j, z;
  for (i = 0; i < n; i++) cin >> c[i];
  sort(c.begin(), c.end());
  for (i = 0; i < n; i++)
    for (j = 1; j < k + 1; j++) dp[i][j] = 0;
  for (i = 1; i < k + 1; i++)
    if (i <= c[0]) dp[0][i] = 1;
  for (i = 1; i < n; i++) {
    for (j = 1; j < k + 1; j++) {
      if (j == 1)
        dp[i][j] = (dp[i - 1][0] + dp[i - 1][1]) % 1000000007;
      else if (j <= c[i])
        dp[i][j] = (dp[i][j - 1] + dp[i - 1][j]) % 1000000007;
      else if (dp[i][j - 1] == 0) {
        break;
      } else {
        dp[i][j] =
            (dp[i][j - 1] - dp[i - 1][j - 1 - c[i]] + 1000000007) % 1000000007;
      }
    }
  }
  if (k == 0)
    cout << 1 << endl;
  else
    cout << dp[n - 1][k] << endl;
  return 0;
}
