#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)1e5 + 7;
const int INF = (int)1e9;
long long a, b[maxn], c, d, cnt, e[(int)2e3 + 1][(int)2e3 + 1], cost[maxn],
    tout[maxn], mn = INF, mx = -INF, l, r;
int main() {
  cin >> a >> c;
  for (int i = 0; i < a; ++i) {
    cin >> b[i];
  }
  for (int i = 1; i < (1 << a); ++i) {
    long long sum = 0, kol = 0;
    for (int j = 0; j < a; ++j) {
      if ((i >> j) & 1) {
        sum += b[j];
        kol++;
      }
    }
    if ((sum / kol) == c && sum % kol == 0) {
      cnt++;
    }
  }
  cout << cnt;
}
