#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  int c = a % b;
  while (c != 0) {
    a = b;
    b = c;
    c = a % b;
  }
  return b;
}
struct UnionFind {
  vector<int> par;
  UnionFind(int N) : par(N) {
    for (int i = 0; i < N; i++) par[i] = i;
  }
  int root(int x) {
    if (par[x] == x) return x;
    return par[x] = root(par[x]);
  }
  void unite(int x, int y) {
    int rx = root(x);
    int ry = root(y);
    if (rx == ry) return;
    par[rx] = ry;
  }
  bool same(int x, int y) {
    int rx = root(x);
    int ry = root(y);
    return rx == ry;
  }
};
const long long M = 1000000007;
vector<long long> fac(300001);
vector<long long> ifac(300001);
long long mpow(long long x, long long n) {
  long long ans = 1;
  while (n != 0) {
    if (n & 1) ans = ans * x % M;
    x = x * x % M;
    n = n >> 1;
  }
  return ans;
}
long long comb(long long a, long long b) {
  if (a == 0 && b == 0) return 1;
  if (a < b || a < 0) return 0;
  long long tmp = ifac[a - b] * ifac[b] % M;
  return tmp * fac[a] % M;
}
int compare(string a, string b) {
  int i;
  for (i = 0; i < a[i] != '\0'; i++) {
    if (b[i] == '\0')
      return -1;
    else if (a[i] < b[i])
      return 1;
    else if (a[i] > b[i])
      return -1;
  }
  if (b[i] != '\0')
    return 1;
  else
    return 0;
}
int main() {
  long long n, a, i, j, k, dp[51][51][2501], ans = 0, x;
  cin >> n >> a;
  for (i = 0; i <= n; i++)
    for (j = 0; j <= n; j++)
      for (k = 0; k <= 50 * n; k++) dp[i][j][k] = 0;
  dp[0][0][0] = 1;
  for (i = 0; i < n; i++) {
    cin >> x;
    for (j = 0; j <= i; j++)
      for (k = 0; k <= 50 * j; k++) dp[i + 1][j + 1][k + x] += dp[i][j][k];
  }
  for (j = 1; j <= n; j++)
    for (k = j; k <= 50 * j; k++)
      if (a * j == k) ans += dp[n][j][k];
  cout << ans << endl;
}
