#include <bits/stdc++.h>
using namespace std;
int arr[55];
long long ans;
bool taken[55];
int n, x;
void recur(int in, int sum, int cnt) {
  if (in > n) {
    if (sum == x * cnt) {
      ans++;
    }
    return;
  }
  recur(in + 1, sum + arr[in], cnt + 1);
  recur(in + 1, sum, cnt);
}
int main() {
  scanf("%d%d", &n, &x);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &arr[i]);
  }
  recur(0, 0, 0);
  printf("%d\n", ans - 1);
}
