#include <bits/stdc++.h>
using namespace std;
int n, a;
long long ans;
map<long long, long long> m;
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> a;
  long long zc = 0;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    x -= a;
    if (x == 0)
      ++zc;
    else if (x > 0) {
      for (auto it = m.rbegin(); it != m.rend(); ++it) {
        m[x + it->first] += it->second;
        if (it == m.rbegin()) ++it;
      }
      ++m[x];
    } else {
      for (auto it = m.begin(); it != m.end(); ++it) {
        m[it->first + x] += it->second;
      }
      ++m[x];
    }
  }
  ans = m[0];
  ans *= powl(2, zc);
  ans += powl(2, zc) - 1ll;
  cout << ans;
}
