#include <bits/stdc++.h>
using namespace std;
int n, a;
vector<int> x(50);
vector<vector<long long>> m(51, vector<long long>(5000, -1));
long long ave(int i, int s) {
  if (i == n) return 0;
  s += x[i];
  long long k = ave(i + 1, s) + ave(i + 1, s - x[i]);
  if (s == 0) k += 1;
  return k;
}
int main() {
  cin >> n >> a;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    x[i] -= a;
  }
  cout << ave(0, 0) << endl;
  return 0;
}
