#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A, dummy;
  dummy = scanf("%d %d", &N, &A);
  char table[0x100];
  for (int i = 0; i < 0x100; i++) {
    int cnt = 0;
    int val = i;
    while (val != 0) {
      if ((val & 1) != 0) cnt++;
      val >>= 1;
    }
    table[i] = cnt;
  }
  long long bitMAX = 1LL << N;
  long long bit;
  char str[51];
  vector<int> vi;
  int tmp1;
  for (int i = 0; i < N; i++) {
    dummy = scanf("%d", &tmp1);
    vi.push_back(tmp1);
  }
  long long ans = 0;
  for (bit = 3; bit < bitMAX; bit++) {
    int count = 0;
    count += table[bit & 0xFF];
    count += table[(bit >> 8) & 0xFF];
    count += table[(bit >> 16) & 0xFF];
    count += table[(bit >> 24) & 0xFF];
    count += table[(bit >> 32) & 0xFF];
    count += table[(bit >> 40) & 0xFF];
    count += table[(bit >> 48) & 0xFF];
    int total = 0;
    int target = A * count;
    for (int i = 0; i < N; i++) {
      if (bit & (1 << i)) {
        total += vi[i];
        if (total > target) break;
      }
    }
    if (total == target) ans++;
  }
  printf("%lld", ans);
  return 0;
}
