#include <bits/stdc++.h>
using namespace std;
const int maxn = 105, maxk = 100005;
const long long modn = 1e9 + 7;
int n, k, a[maxn], sum;
long long f[maxn][maxk];
void pre() {
  sort(a + 1, a + n + 1);
  for (int i = 0; i <= n; i++) f[i][0] = 1;
  for (int i = 0; i <= k; i++) f[0][i] = 1;
}
inline long long getsum(int i, int r, int len) {
  if (r - len - 1 < 0)
    return (long long)((f[i][r]) % modn);
  else
    return (long long)((f[i][r] - f[i][r - len - 1]) % modn);
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  pre();
  for (int i = 1; i <= n - 1; i++) {
    if ((sum + a[i]) >= k)
      sum = k;
    else
      sum += a[i];
    for (int j = 1; j <= k; j++)
      if (j <= sum)
        f[i][j] = (long long)((f[i][j - 1] + getsum(i - 1, j, a[i])) % modn);
      else
        f[i][j] = (long long)((f[i][j - 1]) % modn);
  }
  cout << getsum(n - 1, k, a[n]);
  return 0;
}
