#include <bits/stdc++.h>
using namespace std;
inline long long min(long long a, long long b) { return (a > b) ? b : a; }
inline long long max(long long a, long long b) { return (a > b) ? a : b; }
const int N = 1e6 + 7;
const int inf = 1e9 + 7;
const long long linf = 1e18 + 9;
long long x[51];
map<long long, int> dp, old;
map<long long, int>::iterator it;
int main() {
  int n, a;
  scanf("%d %d", &n, &a);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", x + i);
    x[i] -= a;
  }
  old[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (it = old.begin(); it != old.end(); it++) {
      dp[it->first + x[i]] += it->second;
      dp[it->first] += it->second;
    }
    old.swap(dp);
    dp.clear();
  }
  old[0]--;
  printf("%d", old[0]);
}
