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