#include <iostream>
#include <vector>
#include <algorithm>

long long int count = 0;

void output(std::vector<int> v){
  for(int i=0; i<v.size(); i++){
    std::cout << v[i] << " ";
  }
  std::cout << std::endl;
}


int main(void){
  int n, a;
  std::vector<int> v;
  std::vector<int> min;
  std::vector<int> max;

  
  std::cin >> n >> a;
  for(int i=0; i<n; i++){
    int k;
    std::cin >> k;
    v.push_back(k);
  }
  std::sort(v.begin(), v.end());

  for(int i=0, sum1=0, sum2=0; i<v.size(); i++){
    sum1 += v[i];
    sum2 += v[v.size()-i-1];

    min.push_back(sum1);
    max.push_back(sum2);
  }
  
  for(int i=1; i<(1L<<v.size()); i++){
    int temp = i, cnt = 0;
    std::vector<int> vt;
    while(temp){
      if(temp%2) vt.push_back(v[cnt]);
      cnt++;
      temp = temp/2;
    }
    if(vt.size()*a == std::accumulate(vt.begin(), vt.end(), 0)) count++;
  }

  std::cout << count << std::endl;
  
  return 0;
}