#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, a;
  cin >> n >> a;
  int x[n];
  for (int i = 0; i < n; i++) cin >> x[i];
  long long res = 0;
  for (long long b = 1; b < 1 << n; b++) {
    int sum = 0;
    for (int i = 0; i < n; i++) {
      if ((b >> i) % 2) sum += x[i];
    }
    if (sum == __builtin_popcountll(b) * a) res++;
  }
  cout << res << "\n";
  return 0;
}
