#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
void write(int x) {
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
int n;
int a[100], x;
map<int, long long> f[100];
void ReadInPut() {
  n = read();
  x = read();
  for (int i = (int)1; i <= (int)n; i++) {
    a[i] = read();
    a[i] -= x;
  }
  for (int i = (int)1; i <= (int)n; i++) {
    int v = a[i];
    for (int j = -1000; j <= 1000; j++) {
      f[i][j] += f[i - 1][j - v];
    }
    for (int j = -1000; j <= 1000; j++) f[i][j] += f[i - 1][j];
    f[i][v]++;
  }
  cout << f[n][0];
}
void Solve() {}
int main() {
  int sotest = 1;
  for (int i = 1; i <= sotest; i++) {
    ReadInPut();
    Solve();
  }
}
