#include <bits/stdc++.h>
using namespace std;
int f[101][100001], a[101];
int main() {
  int i, j, k, l, n;
  scanf("%d %d", &n, &k);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  f[0][0] = 1;
  for (i = 1; i <= n; i++)
    for (j = 0; j <= k; j++)
      for (l = 0; l <= min(a[i], j); l++) f[i][j] += f[i - 1][j - l];
  printf("%d", f[n][k]);
  return 0;
}
