/* -------------------------------- Template -------------------------------- */

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <locale>
#include <iostream>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()

using ll = long long;
using ld = long double;

template <typename T> T &chmin(T &a, const T &b) { return a = std::min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = std::max(a, b); }

template<typename T> constexpr T inf = [](){ assert(false); };
// template<> constexpr int inf<int> = 1e9;
// template<> constexpr ll inf<ll> = 1e18;
// template<> constexpr ld inf<ld> = 1e30;

struct yes_no : std::numpunct<char> {
  string_type do_truename()  const { return "Yes"; }
  string_type do_falsename() const { return "No"; }
};

class range {
  class Index {
    int x;
  public:
    Index(int x) : x(x) {}
    int operator*() const { return x; }
    bool operator!=(Index &r) { return x < r.x; }
    void operator++() { ++x; }
  };
  Index i, n;
public:
  range(int n) : i(0), n(n) {}
  range(int i, int n) : i(i), n(n) {}
  Index &begin() { return i; }
  Index &end() { return n; }
};

template <class A, class B> class zip_t {
  using res_t = std::pair<typename A::iterator, typename B::iterator>;
  class iter : public std::iterator<std::input_iterator_tag,
                                    res_t,          // value_type
                                    std::ptrdiff_t, // difference_type
                                    res_t*,         // pointer
                                    res_t> {        // reference
    typename A::iterator a; typename B::iterator b;
  public:
    iter(typename A::iterator a, typename B::iterator b) : a(a), b(b) {}
    res_t operator*() { return res_t(*a, *b); }
    bool operator==(iter x) { return a == x.a; }
    bool operator!=(iter x) { return !(*this == x); }
    iter& operator++() { ++a; ++b; return *this; }
    iter operator++(int) { iter ret = *this; ++(*this); return ret; }
  };
  iter i, n;
public:
  zip_t(A &a, B &b) : i(a.begin(), b.begin()), n(a.end(), b.end()) {}
  iter &begin() { return i; }
  iter &end() { return n; }
};

template<typename A, typename B>
zip_t<A, B> zip(A &a, B &b) { return zip_t<A, B>(a, b); }

void solve();

int main() {
  std::locale loc(std::locale(), new yes_no);
  std::cout << std::boolalpha << std::setprecision(12) << std::fixed;
  std::cout.imbue(loc);
  solve();
  return 0;
}

using namespace std;

/* -------------------------------- Library -------------------------------- */

/* ---------------------------------- Main ---------------------------------- */

ll dp[64][3000];

void solve() {
  int N, A;
  cin >> N >> A;
  vector<int> x(N);
  for (int &i: x) cin >> i;

  dp[0][0] = 1;
  for (int i: range(N)) {
    for (int j = N; j >= 0; --j) {
      for (int k: range(2520)) {
        dp[j+1][k+x[i]] += dp[j][k];
      }
    }
  }
  ll res = 0;
  for (int j: range(1, N+1)) {
    res += dp[j][A * j];
  }
  cout << res << endl;
  return;
}


Measured memory_bytes: 1408