#include <bits/stdc++.h>
using namespace std;
int N, S;
vector<int> v;
int cache[3001][3001];
int solve(int pos, int k) {
  if (k == 0) return N - pos + 1;
  if (pos == N) return 0;
  int& ret = cache[pos][k];
  if (ret != -1) return ret;
  ret = solve(pos + 1, k);
  if (k - v[pos] >= 0) ret += solve(pos + 1, k - v[pos]);
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> N >> S;
  v.resize(N);
  for (int i = 0; i < N; i++) cin >> v[i];
  int ans = 0;
  memset(cache, -1, sizeof(cache));
  for (int i = 0; i < N; i++) ans += solve(i, S);
  cout << ans << "\n";
  return 0;
}
