#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, S;
  cin >> N >> S;
  vector<int> a(N);
  for (int i = 0; i < N; ++i) cin >> a[i];
  sort(a.begin(), a.end());
  vector<long long int> s(N + 1, 0);
  for (int i = 0; i <= N; ++i) s[i + 1] = (s[i] + a[i]) % 998244353;
  long long int count = 0;
  for (int l = 0; l < N; ++l) {
    for (int r = l + 1; r <= N; ++r) {
      if (s[r] - s[l] == S) ++count;
    }
  }
  cout << count << endl;
}
