#include <bits/stdc++.h>
using namespace std;
void rwFile() {
  freopen("INP.inp", "r", stdin);
  freopen("OUT.out", "w", stdout);
}
const int MAXN = 123456;
const long long oo = 1e18;
int DP[123][MAXN];
void solve() {
  int n, k;
  cin >> n >> k;
  int arr[n + 1];
  arr[0] = 0;
  for (int i = 1; i <= n; i++) cin >> arr[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 t = 0; t <= arr[i]; t++) {
        if (j >= t)
          DP[i][j] += DP[i - 1][j - t];
        else
          break;
      }
    }
  }
  cout << DP[n][k];
}
int main() { solve(); }
