#include <bits/stdc++.h>
using namespace std;
int DP[110][100100];
int X[110];
int main() {
  int N, K;
  cin >> N >> K;
  for (int i = 0; i < N; i++) cin >> X[i];
  DP[0][0] = 1;
  for (int i = 0; i < N; i++)
    for (int j = 0; j <= K; j++)
      for (int k = 0; k <= min(X[i], K - j); k++)
        DP[i + 1][j + k] = (DP[i + 1][j + k] + DP[i][j]) % 1000000007;
  cout << DP[N][K];
  return 0;
}
