#include <bits/stdc++.h>
using namespace std;
int a[101];
int n, k;
int mod = 1000000007;
long long dp[101][100001] = {0};
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (int i = 0; i <= k; i++) dp[0][i] = 0;
  for (int i = 0; i <= n; i++) dp[i][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= k; j++) {
      dp[i][j] = dp[i][j - 1] + dp[i - 1][j] -
                 (j - a[i] <= 0 ? 0 : dp[i - 1][j - a[i] - 1]);
      dp[i][j] = dp[i][j] % mod;
      if (dp[i][j] < 0) dp[i][j] = 0;
    }
  }
  cout << dp[n][k] << endl;
  return 0;
}
