#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long dp[102][100010];
long long sum[102][100010];
int main() {
  long long n, k;
  cin >> n >> k;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  dp[0][0] = 1;
  for (long long i = 0; i <= k; i++) sum[0][i] = 1;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j <= k; j++) {
      dp[i][j] += sum[i - 1][j];
      if (j - i > 0) dp[i][j] -= sum[i - 1][j - i - 1];
      dp[i][j] = (dp[i][j] + mod) % mod;
      sum[i][j] = (sum[i][j - 1] + dp[i][j]) % mod;
    }
  }
  cout << dp[n][k] << endl;
}
