#include <bits/stdc++.h>
using namespace std;
long long dp[105][100009] = {0}, sum[105][100009];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k, a[105];
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= k; j++) {
      if (j == 0)
        dp[i][j] = 1;
      else if (j <= a[i]) {
        dp[i][j] = (1 + sum[i - 1][j] - sum[i - 1][0]) % 1000000007;
        sum[i][j] = (dp[i][j] + sum[i][j - 1]) % 1000000007;
      } else {
        dp[i][j] = (sum[i - 1][j] - sum[i - 1][j - a[i] - 1]) % 1000000007;
        sum[i][j] = (dp[i][j] + sum[i][j - 1]) % 1000000007;
      }
    }
  }
  cout << dp[n][k];
  return 0;
}
