#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <class T1, class T2>
void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const long long int LINF = 1001002003004005006ll;
const int INF = 1001001001;
const long long int mod = 1e9 + 7;
const double PI = 3.14159265358979323846;
int n, a;
vector<int> x(n);
int memo[55][55][2555];
int rec(int idx, int maisuu, int sum) {
  if (idx >= n) {
    return ((maisuu * a) == sum) && (sum != 0);
  }
  if (memo[idx][maisuu][sum] != -1) {
    return memo[idx][maisuu][sum];
  }
  int ret = 0;
  int yes = rec(idx + 1, maisuu + 1, sum + x[idx]);
  int no = rec(idx + 1, maisuu, sum);
  ret += yes + no;
  return memo[idx][maisuu][sum] = ret;
}
int main() {
  cin >> n >> a;
  x.resize(n);
  for (int i = 0; i < n; i++) cin >> x[i];
  memset(memo, -1, sizeof(memo));
  int ans = rec(0, 0, 0);
  cout << ans << endl;
  return 0;
}
