#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 111;
const int mod = 1e9 + 7;
int n, k, dp[200][maxn], a[maxn];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 0; i <= a[1]; i++) dp[1][i] = 1;
  for (int i = 2; i <= n; i++)
    for (int j = 0; j <= a[i]; j++)
      for (int q = 0; q <= k; q++)
        if (q + j <= k) {
          dp[i][q + j] += dp[i - 1][q];
          dp[i][j] %= mod;
        }
  cout << dp[n][k];
}
