#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int n, k;
int a[100005];
long long dp[105][100005];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= k; j++) {
      for (int m = 0; m <= min(a[i], j); m++) {
        dp[i][j] = (dp[i][j] + dp[i - 1][j - m]) % mod;
      }
    }
  }
  printf("%lld\n", dp[n][k]);
  return 0;
}
