#include <bits/stdc++.h>
using namespace std;
long long ans = 0;
int N, A, x[100];
void solve(int sum, int num, int count) {
  if (num == N) {
    if (count == 0) return;
    if (count * A == sum) ans++;
    return;
  }
  solve(sum + x[num], num + 1, count + 1);
  solve(sum, num + 1, count);
}
int main() {
  cin >> N >> A;
  for (int i = 0; i < N; i++) {
    cin >> x[i];
  }
  solve(0, 0, 0);
  cout << ans << endl;
}
