#include <bits/stdc++.h>
using namespace std;
int n, k, arr[101], dp[101][100001], pre[101][100001];
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  for (int i = 0; i <= arr[0]; i++) {
    dp[0][i] = 1;
    pre[0][i] = i + 1;
  }
  for (int i = 1; i < n; i++) {
    dp[i][0] = 1;
    pre[i][0] = 1;
    for (int j = 1; j <= arr[i]; j++) {
      if (j - arr[i] - 1 > -1)
        dp[i][j] = pre[i - 1][min(j, arr[i - 1])] -
                   pre[i - 1][min(j - arr[i] - 1, arr[i - 1])];
      else
        dp[i][j] = pre[i - 1][min(j, arr[i - 1])];
      pre[i][j] = dp[i][j] + pre[i][j - 1];
    }
  }
  cout << dp[n - 1][k - 1];
  return 0;
}
