#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k;
  cin >> n >> k;
  long long int a[n];
  long long int presum[n];
  memset(presum, 0, sizeof(presum));
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  presum[0] = a[0];
  long long int maxa = a[n - 1];
  for (long long int i = 1; i < n; i++) {
    presum[i] = presum[i - 1] % 1000000007 + a[i];
    presum[i] = presum[i] % 1000000007;
  }
  long long int dp[n][k + 1];
  memset(dp, 0, sizeof(dp));
  for (long long int j = 0; j < n; j++) {
    for (long long int i = 0; i <= k; i++) {
      if (presum[j] % 1000000007 < i) {
        dp[j][i] = 0;
      } else if (i == 0) {
        dp[j][i] = 1;
      } else if (j == 0 && presum[0] >= i) {
        dp[j][i] = 1;
      } else if (j > 0) {
        for (long long int x = 0; x <= min(a[j], i); x++) {
          if (i >= x) {
            dp[j][i] += (dp[j - 1][i - x] + 1000000007) % 1000000007;
            dp[j][i] = dp[j][i] % 1000000007;
          }
        }
      }
    }
  }
  cout << dp[n - 1][k] % 1000000007 << "\n";
  return 0;
}
