#include <bits/stdc++.h>
#pragma GCC optimize("-O2")
using namespace std;
void err(istream_iterator<string> it) { cerr << endl; }
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << "\t";
  err(++it, args...);
}
template <typename T1, typename T2>
ostream& operator<<(ostream& c, pair<T1, T2>& v) {
  c << "(" << v.first << "," << v.second << ")";
  return c;
}
template <template <class...> class TT, class... T>
ostream& operator<<(ostream& out, TT<T...>& c) {
  out << "{ ";
  for (auto& x : c) out << x << " ";
  out << "}";
  return out;
}
const int LIM = 1e5 + 5, MOD = 1e9 + 7;
int t, n, m, k, x, y;
long long int dp[101][LIM];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  dp[0][0] = 1;
  dp[0][1] = -1;
  for (int i = 0; i < n; i++) {
    cin >> x;
    long long int c = 0;
    for (int j = 0; j < k + 1; j++) {
      c += dp[i][j];
      c = (c + MOD) % MOD;
      dp[i + 1][j] = c;
      if (j + x < LIM) dp[i + 1][j + x] = -c;
    }
  }
  long long int ans = 0;
  for (int i = 0; i < k + 1; i++) ans = (ans + dp[n][i]) % MOD;
  ans = (ans + MOD) % MOD;
  cout << ans << "\n";
  return 0;
}
