#include <bits/stdc++.h>
using namespace std;
long long int n, k, arr[101], dp[101][100001], pre[101][100001], top = 0;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    top += arr[i];
  }
  sort(arr, arr + n);
  for (int i = 0; i <= min(k, arr[0]); i++) {
    dp[0][i] = 1;
    pre[0][i] = i + 1;
  }
  long long int ek = arr[0];
  for (long long int i = 1; i < n; i++) {
    dp[i][0] = 1;
    pre[i][0] = 1;
    for (long long int j = 1; j <= min(arr[i] + ek, k + 1); j++) {
      if (j - arr[i] - 1 > -1)
        dp[i][j] =
            (pre[i - 1][min(j, ek)] - pre[i - 1][j - arr[i] - 1] + 1000000007) %
            1000000007;
      else
        dp[i][j] = pre[i - 1][min(j, ek)];
      pre[i][j] = (dp[i][j] + pre[i][j - 1]) % 1000000007;
    }
    if (ek + arr[i] <= k) ek += arr[i];
  }
  cout << dp[n - 1][k];
  return 0;
}
