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