#include <bits/stdc++.h>
using namespace std;
const int mxN = 101;
const int modd = 1e9 + 7;
int a[mxN];
int suf[mxN];
int dp[mxN][100003];
int ans = 0, n;
int rfun(int ind, int k) {
  if (ind == n) {
    ans++;
    if (ans >= modd) {
      ans -= modd;
    }
    return 1;
  }
  if (k < 0) return 0;
  if (dp[ind][k] != -1) return dp[ind][k];
  int an = 0;
  for (int i = max(0, (k - suf[ind + 1])); i <= min(k, a[ind]); i++) {
    an += rfun(ind + 1, k - i);
    an %= modd;
  }
  return dp[ind][k] = an;
}
int main() {
  int k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  memset(dp, -1, sizeof dp);
  suf[n - 1] = a[n - 1];
  for (int i = n - 1; i >= 0; i--) {
    suf[i] = suf[i + 1] + a[i];
  }
  ans = rfun(0, k);
  cout << ans;
}
