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