#include <bits/stdc++.h>
using namespace std;
int N, A;
int x[50];
int dpp[2500];
int dpm[2500];
int zero = 0, maxp = 0, maxm = 0;
long long int ret = 0;
int main() {
  for (int i = 0; i < 50; ++i) {
    x[i] = 0;
    for (int j = 0; j < 50; ++j) {
      dpp[i * 50 + j] = 0;
      dpm[i * 50 + j] = 0;
    }
  }
  dpp[0] = 1;
  dpm[0] = 1;
  cin >> N >> A;
  for (int i = 0; i < N; ++i) {
    int a;
    cin >> a;
    x[i] = a - A;
  }
  for (int i = 0; i < N; ++i) {
    if (x[i] > 0) {
      for (int j = maxp; j >= 0; --j) {
        if (dpp[j] != 0 && j + x[i] < 2500) {
          dpp[j + x[i]] += dpp[j];
        }
      }
      maxp += x[i];
    } else if (x[i] < 0) {
      for (int j = maxm; j >= 0; --j) {
        if (dpm[j] != 0 && j - x[i] < 2500) {
          dpm[j - x[i]] += dpm[j];
        }
      }
      maxm -= x[i];
    } else {
      zero++;
    }
  }
  long long int xeros = ((long long int)(1) << zero);
  ret = xeros - 1;
  for (int i = 1; i < 2500; i++) {
    ret += dpp[i] * dpm[i] * xeros;
  }
  cout << ret << endl;
  return 0;
}
