#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int target, n;
ll ans = 0;
vector<int> x;
void dfs(int i, int num, int sum) {
  if (i == n) {
    if (num > 0 and sum == target * num) {
      ans++;
    }
    return;
  }
  dfs(i + 1, num, sum);
  dfs(i + 1, num + 1, sum + x[i]);
  return;
}
int main() {
  cin >> n >> target;
  for (int i = (0); i < (n); i++) {
    int xx;
    cin >> xx;
    x.push_back(xx);
  }
  dfs(0, 0, 0);
  cout << ans << endl;
  return 0;
}
