#include <bits/stdc++.h>
using namespace std;
const long long int INF = (long long int)(1e18) + 1;
const int INF_INT = 2147483647 - 1e6;
const long long int mod = 1000000007ll;
long long int N, K;
long long int a[100];
long long int ans = 0;
void solve() {
  sort(a, a + N);
  vector<vector<long long int>> dp(N + 1, vector<long long int>(K + 1, 0));
  for (int i = 0; i <= N; i++) dp[i][0] = 1;
  long long int a_sum = 0;
  for (int i = 1; i <= N; i++) {
    a_sum += a[i - 1];
    for (int j = 1; j <= K; j++) {
      if (a_sum < j) continue;
      dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % mod;
      if (j - a[i - 1] - 1 >= 0) {
        dp[i][j] -= dp[i - 1][j - a[i - 1] - 1] + mod;
        dp[i][j] %= mod;
      }
    }
  }
  ans = dp[N][K];
}
int main() {
  cin >> N >> K;
  for (int i = 0; i < N; i++) cin >> a[i];
  solve();
  cout << ans << endl;
  return 0;
}
