#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int M = 100111;
const int inf = 1000000007;
const long long INF = 1000000000000000007;
int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, -1, 0, 1};
int ddx[8] = {1, -1, 0, 0, 1, -1, -1, 1}, ddy[8] = {0, 0, 1, -1, 1, -1, 1, -1};
int main() {
  int n, m;
  int a[M];
  ll dp[101][101] = {};
  cin >> n >> m;
  for (ll i = 0; i < n; i++) cin >> a[i];
  dp[0][0] = 1;
  for (ll i = 1; i < n + 1; i++) {
    for (ll j = 0; j < m + 1; j++) {
      for (int k = j; k >= 0; k--) {
        if (k + a[i - 1] < j) break;
        dp[i][j] += dp[i - 1][k];
        dp[i][j] %= inf;
      }
    }
  }
  cout << dp[n][m] << endl;
}
