#include <bits/stdc++.h>
using namespace std;
const int M = 102;
int a[M], dp[M][M];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 0; i <= n; i++) dp[i][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= k; j++) {
      for (int l = 0; l <= a[i]; l++) {
        if (j >= l) dp[i][j] += dp[i - 1][j - l];
      }
    }
  }
  cout << dp[n][k];
  return 0;
}
