#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
ostream& operator<<(ostream& o, const pair<T1, T2> p) {
  o << "(" << p.first << ":" << p.second << ")";
  return o;
}
int n, ave, high, low = 10000;
long long int data[60];
long long int datas[60];
int main() {
  int i, j, k, l;
  cin >> n >> ave;
  for (i = 0; i < n; i++) {
    cin >> k;
    datas[i] = k;
  }
  long long int result = 0;
  int b, c;
  for (i = 1; i < (1 << n); i++) {
    b = i;
    k = c = 0;
    for (j = 0; 0 < b; j++, b = b >> 1) {
      if (b & 1) {
        k += datas[j];
        c++;
      }
    }
    if (k == ave * c) {
      result++;
    }
  }
  cout << result << endl;
  return 0;
}
