#include <bits/stdc++.h>
using namespace std;
long long dp[101][100001];
int main() {
  long long N, K;
  cin >> N >> K;
  long long arr[N];
  for (long long i = 0; i < N; i++) {
    cin >> arr[i];
  }
  for (long long i = 0; i <= N; i++) {
    for (long long j = 0; j <= K; j++) {
      dp[i][j] = 0;
    }
  }
  for (long long i = 0; i <= N; i++) {
    dp[i][0] = 1;
  }
  for (long long i = 1; i <= N; i++) {
    for (long long j = 1; j <= K; j++) {
      for (long long k = 0; k <= arr[i - 1]; k++) {
        if (j - k >= 0) dp[i][j] += dp[i - 1][j - k];
      }
    }
  }
  cout << dp[N][K] << endl;
}
