#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  int b[70];
  cin >> n >> a;
  for (int i = 0; i < n; i++) cin >> b[i];
  long long ans = 0;
  for (int i = 1; i < 1 << n; i++) {
    int cur = 0, num = 0;
    for (int j = 0; j < n; j++) {
      if (i >> j & 1) {
        cur += b[j];
        num++;
      }
    }
    if (cur == num * a) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
