#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A;
  cin >> N >> A;
  int x[55], st = -1, en = -1;
  for (int i = 0; i < N; ++i) {
    cin >> x[i];
    x[i] -= A;
  }
  sort(x, x + N);
  for (int i = 0; i < N; ++i) {
    if (st == -1 && x[i] >= 0) st = i;
    if (en == -1 && x[i] > 0) en = i;
  }
  long long S;
  if (st == -1 || en == 0)
    S = 0;
  else if (en == -1)
    S = pow(2, N - st) - 1;
  else if (st == 0)
    S = pow(2, en) - 1;
  else {
    int c[2][3000];
    c[0][0] = 1;
    c[1][0] = 1;
    for (int i = 1; i < 3000; ++i) {
      c[0][i] = 0;
      c[1][i] = 0;
    }
    for (int i = 0; i < st; ++i) {
      for (int j = 2999; j >= 0; --j) {
        if (c[0][j]) c[0][j - x[i]] += c[0][j];
      }
    }
    for (int i = en; i < N; ++i) {
      for (int j = 2999; j >= 0; --j) {
        if (c[1][j]) c[1][j + x[i]] += c[1][j];
      }
    }
    for (int i = 0; i < 3000; ++i) S += c[0][i] * c[1][i];
    S = S * pow(2, en - st) - 1;
  }
  cout << S << endl;
  return 0;
}
