#include <bits/stdc++.h>
using namespace std;
static const int MAX = 50;
int N, A;
int x[MAX];
long long ans;
void selectCard(int sum, int key, int num) {
  if (num != 0 && (float)sum / (float)num == A) {
    ans += 1;
  }
  for (int i = key + 1; i < N; i++) {
    selectCard(sum + x[i], i, num + 1);
  }
}
int main() {
  ans = 0;
  scanf("%d", &N);
  scanf("%d", &A);
  for (int i = 0; i < N; i++) {
    scanf("%d", &x[i]);
  }
  selectCard(0, -1, 0);
  cout << ans << endl;
  return 0;
}
