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