#include <bits/stdc++.h>
using namespace std;
const int N(1e5 + 9);
int n, m, ans;
int a[109], f[109][N];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i <= n; i++) {
    f[i][0] = 1;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      for (int k = 0; k <= a[i]; k++) {
        if (j >= k) {
          f[i][j] += f[i - 1][j - k];
        }
      }
    }
  }
  cout << f[n][m] << endl;
}
