#include <bits/stdc++.h>
using namespace std;
const int N = 55;
const int inf = 1e9;
const long long INF = 1e18;
const double PI = acos(-1.0);
const double EPS = 1e-8;
const int MOD = 1000000007;
int n, x;
int a[N];
long long int dp[55][55][3000];
long long int solve(int idx, int sum, int taken) {
  if (idx > n) {
    return taken && sum == taken * x;
  }
  if (dp[idx][taken][sum] != -1) return dp[idx][taken][sum];
  long long int ret = 0;
  ret += solve(idx + 1, sum + a[idx], taken + 1);
  ret += solve(idx + 1, sum, taken);
  return dp[idx][taken][sum] = ret;
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> x;
  for (int i = 1; i <= n; i++) cin >> a[i];
  memset(dp, -1, sizeof(dp));
  cout << solve(1, 0, 0) << "\n";
  return 0;
}
