#include <bits/stdc++.h>
using namespace std;
int n, t, i, j, x, k;
long long dp[105][100005];
long long ans;
int main() {
  cin >> n >> k;
  dp[0][0] = 1;
  for (i = 1; i <= n; i++) {
    cin >> x;
    for (j = 0; j <= x; j++) {
      for (int it = 0; it + j <= k; it++) {
        dp[i][j + it] += dp[i - 1][it];
        dp[i][j + it] %= 1000000007;
      }
    }
  }
  cout << dp[n][k];
  return 0;
}
