#include <bits/stdc++.h>
#pragma GCC optimize( \
    "Ofast,no-stack-protector,unroll-loops,no-stack-protector,fast-math")
using namespace std;
const int N = 2e5 + 5, M = 2 * N + 5;
int n, a[20], ans, tar;
long long dp[51][2501][51];
long long solve(int i, int sum, int cnt) {
  if (i == n) {
    if (!cnt) return 0;
    long double tmp = 1.0L * sum / cnt;
    return (tmp == tar);
  }
  long long &ret = dp[i][sum][cnt];
  if (~ret) return ret;
  ret = 0;
  ret += solve(i + 1, sum, cnt);
  ret += solve(i + 1, sum + a[i], cnt + 1);
  return ret;
}
int main() {
  scanf("%d %d", &n, &tar);
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  memset(dp, -1, sizeof dp);
  printf("%lld\n", solve(0, 0, 0));
}
