#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int INF = 999999999;
int a, b, k[55], mon, sum, ans;
int main() {
  cin >> a >> b;
  for (int i = 0; i < a; ++i) {
    cin >> k[i];
  }
  for (int bit = 0; bit < (1 << a); ++bit) {
    mon = 0;
    sum = 0;
    for (int i = 0; i < a; ++i) {
      if (bit & (1 << i)) {
        ++mon;
        sum += k[i];
      }
    }
    if (mon != 0) {
      if ((double)sum / mon == b) {
        ++ans;
      }
    }
  }
  cout << ans << endl;
}
