#include <bits/stdc++.h>
using namespace std;
int in() {
  int x;
  scanf("%d", &x);
  return x;
}
long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
void print(vector<int> v) {
  for (auto e : v) cout << e << " ";
  cout << "\n";
}
void print(vector<long long> v) {
  for (auto e : v) cout << e << " ";
  cout << "\n";
}
void print(map<int, int> mp) {
  for (auto e : mp) cout << e.first << " " << e.second << "\n";
  cout << "\n";
}
const long long MOD = 1e9 + 7;
const int N = 500000;
int main() {
  int n = in();
  int a = in();
  vector<int> v;
  for (long long i = 0; i < n; i++) v.push_back(in() - a);
  vector<map<int, long long>> dp(n + 1);
  dp[0][0] = 1;
  for (long long i = 0; i < n; i++) {
    for (auto e : dp[i]) {
      dp[i + 1][e.first + v[i]] += e.second;
      dp[i + 1][e.first] += e.second;
    }
  }
  cout << dp[n][0];
}
