#include <bits/stdc++.h>
using namespace std;
int n, k;
int dp[110][100009];
int s[110][100009];
const int mod = 1e9 + 7;
int main() {
  scanf("%d%d", &n, &k);
  dp[0][k] = s[0][k] = 1;
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    for (int j = 0; j <= k; j++) {
      for (int m = 0; m <= min(x, k - j); m++) dp[i][j] += dp[i - 1][j + m];
    }
  }
  cout << dp[n][0] << endl;
  return 0;
}
