#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T SQR(T x) {
  return x * x;
}
template <typename T>
inline void UPDATE_MIN(T &x, T y) {
  if (y < x) {
    x = y;
  }
}
template <typename T>
inline void UPDATE_MAX(T &x, T y) {
  if (x < y) {
    x = y;
  }
}
template <typename T>
inline int ARGMAX(T cont) {
  return max_element(cont.begin(), cont.end()) - cont.begin();
}
template <typename T>
inline int ARGMIN(T cont) {
  return min_element(cont.begin(), cont.end()) - cont.begin();
}
template <typename T>
inline int hamming(T x) {
  return __builtin_popcountll((long long)x);
}
int hamming(int x) { return __builtin_popcount(x); }
int hamming(long x) { return __builtin_popcountl(x); }
int hamming(long long x) { return __builtin_popcountll(x); }
vector<string> split(const string &s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) v.emplace_back(x);
  return move(v);
}
template <typename T, typename... Args>
inline string arrStr(T arr, int n) {
  stringstream s;
  s << "[";
  for (__typeof(n - 1) i = (0), __tmpvar__end89 = (n - 1); i < __tmpvar__end89;
       i++)
    s << arr[i] << ",";
  s << arr[n - 1] << "]";
  return s.str();
}
template <class T>
inline string TOSTR(const T &x) {
  stringstream ss;
  ss << x;
  return ss.str();
}
inline void PR(void) {}
inline void PR(int x) { printf("%d", x); }
inline void PR(long long x) { printf("%lld", x); }
inline void PR(size_t x) { printf("%llu", (unsigned long long)x); }
inline void PR(const char *s) { printf("%s", s); }
inline void PR(double f) { printf("%.10f", f); }
inline void PR(long double f) { printf("%.10f", (double)f); }
template <typename T>
inline void PR(vector<T> &vec) {
  auto sz = vec.size();
  for (auto x : vec) {
    PR(x);
    (--sz) ? putc(0x20, stdout) : 0;
  }
}
template <typename T>
inline void PRS(T x) {
  PR(x);
  putc(0x20, stdout);
}
template <typename T>
inline void PRN(T x) {
  PR(x);
  putc(0x0a, stdout);
}
void PRN(void) { putc(0x0a, stdout); }
struct pairhash {
  template <typename T, typename U>
  std::size_t operator()(const std::pair<T, U> &x) const {
    return std::hash<T>()(x.first) ^ std::hash<U>()(x.second);
  }
};
const int MOD = 1000 * 1000 * 1000 + 7;
const double PI = 3.1415926535897932384626433832795l;
template <typename T>
inline T gcd(T a, T b) {
  return a ? gcd(b % a, a) : b;
}
inline void addto(int &a, int b) {
  a += b;
  if (a >= MOD) a -= MOD;
}
inline int add(int a, int b) {
  a += b;
  if (a >= MOD) a -= MOD;
  return a;
}
inline void subto(int &a, int b) {
  a -= b;
  if (a < 0) a += MOD;
  if (a >= MOD) a -= MOD;
}
inline int sub(int a, int b) {
  a -= b;
  if (a < 0) a += MOD;
  if (a >= MOD) a -= MOD;
  return a;
}
inline void multo(int &a, int b) { a = (long long)a * b % MOD; }
inline int mul(int a, int b) { return (long long)a * b % MOD; }
inline int mulmod(int a, int b, int mod) { return (long long)a * b % mod; }
inline int powmod(int a, int e, int mod) {
  int x;
  for (x = 1; e > 0; e >>= 1) {
    if (e & 1) x = mulmod(x, a, mod);
    a = mulmod(a, a, mod);
  }
  return x;
}
inline int invmod_prime(int a, int mod) { return powmod(a, mod - 2, mod); }
inline long long invmod_LL(long long p) {
  long long q = p;
  for (long long a = p * p; a != 1; a *= a) q *= a;
  return q;
}
int N, A;
int arr[100] = {};
int ways1[25 * 50 + 1][26] = {};
int ways2[25 * 50 + 1][26] = {};
int main() {
  ios_base::sync_with_stdio(0);
  scanf("%d%d", &N, &A);
  for (__typeof(N) i = (0), __tmpvar__end221 = (N); i < __tmpvar__end221; i++)
    scanf("%d", &arr[i]);
  int H1 = N / 2;
  int H2 = N - H1;
  1;
  ways1[0][0] = 1;
  ways2[0][0] = 1;
  for (__typeof(H1) i = (0), __tmpvar__end227 = (H1); i < __tmpvar__end227;
       i++) {
    int v = arr[i];
    for (__typeof(H1 * 50 + 1) new_sum = (H1 * 50 + 1) - 1,
                               __tmpvar__end229 = (v);
         new_sum >= __tmpvar__end229; new_sum--) {
      for (__typeof(H1 + 1) new_elem = (H1 + 1) - 1, __tmpvar__end230 = (1);
           new_elem >= __tmpvar__end230; new_elem--) {
        ways1[new_sum][new_elem] += ways1[new_sum - v][new_elem - 1];
      }
    }
  }
  for (__typeof(H2) i = (0), __tmpvar__end242 = (H2); i < __tmpvar__end242;
       i++) {
    int v = arr[H1 + i];
    for (__typeof(H2 * 50 + 1) new_sum = (H2 * 50 + 1) - 1,
                               __tmpvar__end244 = (v);
         new_sum >= __tmpvar__end244; new_sum--) {
      for (__typeof(H2 + 1) new_elem = (H2 + 1) - 1, __tmpvar__end245 = (1);
           new_elem >= __tmpvar__end245; new_elem--) {
        ways2[new_sum][new_elem] += ways2[new_sum - v][new_elem - 1];
      }
    }
  }
  long long ans = 0;
  for (__typeof(N + 1) take = (1), __tmpvar__end251 = (N + 1);
       take < __tmpvar__end251; take++) {
    int need_sum = take * A;
    1;
    for (__typeof(need_sum + 1) sum1 = (0), __tmpvar__end254 = (need_sum + 1);
         sum1 < __tmpvar__end254; sum1++) {
      for (__typeof(take + 1) take1 = (0), __tmpvar__end255 = (take + 1);
           take1 < __tmpvar__end255; take1++) {
        int sum2 = need_sum - sum1;
        int take2 = take - take1;
        if (ways1[sum1][take1] * ways2[sum2][take2]) 1;
        ans += ways1[sum1][take1] * 1ll * ways2[sum2][take2];
      }
    }
  }
  PRN(ans);
  return 0;
}
