#include <bits/stdc++.h>
const int MXN = 1e5 + 200;
const long long MNN = 3e3 + 200;
const long long MOD = 1e9 + 7;
const long long INF = 1e13;
const int OO = 1e9 + 500;
using namespace std;
int n, k, a[102], dp[MXN];
int main() {
  ios_base::sync_with_stdio(0), cout.tie(0), cin.tie(0);
  ;
  cin >> n >> k;
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    for (int j = k; j >= 0; j--) {
      int l = j + 1;
      int r = j + min(a[i], k - j);
      for (int lol = l; lol <= r; lol++) {
        dp[lol] += dp[j];
      }
    }
  }
  cout << dp[k];
}
