#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
long long n, a;
long long dp[100][1000];
long long f(long long i, long long p) {
  if (dp[i][p + a] >= 0) return dp[i][p + a];
  if (i == v.size()) return (p == 0 ? 1 : 0);
  return dp[i][p + a] = (f(i + 1, p) + f(i + 1, p + v[i]));
}
signed main() {
  cin >> n >> a;
  for (long long i = 0; i <= n; i++)
    for (long long j = 0; j <= 300; j++) dp[i][j] = -1;
  long long p = 1;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    if (x == a) {
      p *= 2;
    } else
      v.push_back(x - a);
  }
  cout << p * f(0, 0) - 1 << endl;
}
