#include <bits/stdc++.h>
using namespace std;
int k, dem;
int n;
double p;
int a[1000], b[1000], c[1000];
void tohop(int i) {
  for (int j = c[i - 1] + 1; j <= n - k + i; j++) {
    a[i] = b[j];
    c[i] = j;
    if (i == k) {
      double s = 0;
      for (int i = 1; i <= k; i++) {
        s = s + a[i];
      }
      if ((double)s / k == p) dem++;
    } else {
      tohop(i + 1);
    }
  }
}
int main() {
  cin >> n >> p;
  b[0] = 0;
  a[0] = 0;
  c[0] = 0;
  dem = 0;
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
  }
  for (k = 1; k <= n; k++) {
    tohop(1);
  }
  cout << dem;
  return 0;
}
