#include <bits/stdc++.h>
using namespace std;
long long x[51];
long long small[51];
long long large[51];
int main() {
  long long n, a;
  cin >> n >> a;
  long long small_num = 0;
  long long equal_num = 0;
  long long large_num = 0;
  for (long long i = 0; i < n; ++i) {
    cin >> x[i];
    if (x[i] > a) {
      large[large_num++] = x[i] - a;
    } else if (x[i] == a) {
      equal_num++;
    } else {
      small[small_num++] = a - x[i];
    }
  }
  if (large_num < small_num) {
    swap(small, large);
    swap(small_num, large_num);
  }
  long long ans = 0;
  if (small_num <= large_num) {
    for (long long i = 1; i < (1LL << small_num); ++i) {
      long long sum = 0;
      for (long long j = 0; j < small_num; ++j) {
        if ((i >> j) & 1) {
          sum += small[j];
        }
      }
      for (long long k = 1; k < (1LL << large_num); ++k) {
        long long large_sum = 0;
        for (long long l = 0; l < large_num; ++l) {
          if ((k >> l) & 1) {
            large_sum += large[l];
          }
        }
        if (sum == large_sum) {
          ans++;
        }
      }
    }
  }
  cout << (ans * (1LL << equal_num) + (1LL << equal_num) - 1) << endl;
  return 0;
}
