#include <bits/stdc++.h>
using namespace std;
bool compare(int i, int j) { return i > j; }
long long solve(int arr[], int i, int sum, int sze, int N, int cnt, int A) {
  if (i >= N) return cnt;
  sum += arr[i];
  sze++;
  long double s = sum / (sze + 0.0);
  if (A == s) {
    cnt++;
  }
  for (int j = i + 1; j < N; j++) {
    cnt += (solve(arr, j, sum, sze, N, cnt, A) - cnt);
  }
  return cnt;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N, A;
  cin >> N >> A;
  int arr[N];
  for (int i = 0; i < N; i++) {
    cin >> arr[i];
  }
  long long cnt = 0;
  for (int i = 0; i < N; i++) {
    cnt += solve(arr, i, 0, 0, N, 0, A);
  }
  cout << cnt;
  return 0;
}
