#include <bits/stdc++.h>
using namespace std;
const int MAX = 101;
const int KAX = 1e5 + 1;
int N, K;
int a[MAX];
int dp[MAX][KAX];
int main() {
  cin >> N >> K;
  for (int i = 1; i <= N; i++) {
    cin >> a[i];
  }
  dp[0][0] = 1;
  for (int i = 1; i <= N; i++) {
    long long sum = 0;
    for (int j = 0; j <= K; j++) {
      sum += dp[i - 1][j];
      dp[i][j] += sum;
      if (j - a[i] >= 0) {
        sum -= dp[i - 1][j - a[i]];
      }
    }
  }
  cout << dp[N][K];
  return 0;
}
