#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void chmax(T& a, T b) {
  if (a < b) a = b;
}
template <class T>
inline void chmin(T& a, T b) {
  if (a > b) a = b;
}
const long long INF = 1LL << 60;
int N, K;
int a[110];
long long int dp[110][110000];
int main() {
  cin >> N >> K;
  for (int i = 0; i < N; ++i) cin >> a[i];
  dp[0][K] = 1;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j <= K; ++j) {
      for (int k = 0; k <= a[i]; ++k) {
        dp[i + 1][j - k] += dp[i][j];
      }
    }
  }
  cout << dp[N][0] % 1000000007 << endl;
  return 0;
}
