#include <bits/stdc++.h>
using namespace std;
const int N = 55;
const long long INF = ~0u >> 2;
long long dp[N][N * N * 2], n, a[N], A;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return f * x;
}
int main() {
  n = read();
  A = read();
  for (int i = 1; i <= n; ++i) a[i] = read(), a[i] -= A;
  dp[0][2500] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 2500; j <= 5000; ++j) {
      dp[i][j] = dp[i - 1][j] + dp[i - 1][j + a[i]];
    }
  }
  printf("%lld", dp[n][2500]);
  return 0;
}
