#include <bits/stdc++.h>
using namespace std;
int n, k, d[105][100005], a[105];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  d[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= k; j++) {
      for (int p = 0; p <= min(a[i], j); p++) d[i][j] += d[i - 1][j - p];
    }
  }
  cout << d[n][k];
  return 0;
}
