#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int inf = 1e9;
const int mod = 1e9 + 7;
const int maxn = 5e5 + 10;
int n;
int a[55], x;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> x;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int ans = 0;
  for (int i = 0; i < (1 << n); i++) {
    int ret = 0, cnt = 0;
    for (int j = 0; j < n; j++) {
      if ((i >> j) & 1) {
        cnt++;
        ret += a[j];
      }
    }
    if (cnt == 0) continue;
    if (ret % cnt == 0 && ret / cnt == x) ans++;
  }
  cout << ans << endl;
  return 0;
}
