#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const double PI2 = 8.0 * atan(1.0);
int N, A;
int x[50];
long long dfs(int a, long long s) {
  if (a >= N) return (s == 0 ? 1 : 0);
  return dfs(a + 1, s) + dfs(a + 1, s + x[a]);
}
int main(int argc, char **argv) {
  cin >> N >> A;
  for (int i = 0; i < (int)N; ++i) cin >> x[i];
  for (int i = 0; i < (int)N; ++i) x[i] -= A;
  cout << (dfs(0, 0) - 1) << endl;
  return 0;
}
