#include <bits/stdc++.h>
long long mod = 1e9 + 7;
class Mint {
 public:
  long long x;
  Mint(){};
  Mint(long long a) {
    x = a % mod;
    while (x < 0) {
      x += mod;
    }
  };
  Mint &operator+=(const Mint &a) {
    x += a.x;
    x %= mod;
    return *this;
  }
  Mint &operator-=(const Mint &a) {
    x += (mod - a.x);
    x %= mod;
    return *this;
  }
  Mint &operator*=(const Mint &a) {
    x *= a.x;
    x %= mod;
    return *this;
  }
  Mint pow(Mint a, long long n) const {
    Mint y(1);
    Mint b(a);
    while (n > 0) {
      if (n & 1) y *= b;
      b *= b;
      n >>= 1;
    }
    return y;
  }
  Mint modinv(const Mint &a) const { return pow(a, mod - 2); }
  Mint &operator/=(const Mint &a) {
    x *= modinv(a).x;
    x %= mod;
    return *this;
  }
  Mint operator+(Mint &a) const {
    Mint y(*this);
    y += a;
    return y;
  }
  Mint operator-(Mint &a) const {
    Mint y(*this);
    y -= a;
    return y;
  }
  Mint operator*(Mint &a) const {
    Mint y(*this);
    y *= a;
    return y;
  }
  Mint operator/(Mint &a) const {
    Mint y(*this);
    y /= a;
    return y.x;
  }
  Mint nCk(Mint &n, const long long k) const {
    Mint y = Mint(1);
    for (Mint i(0); (i.x) < k; i.x++) {
      y *= (n - i);
      y /= i;
    }
    return y;
  }
  Mint nPk(Mint &n, long long k) const {
    Mint y(1);
    for (Mint i(0); (i.x) < k; i.x++) {
      y *= (n - i);
    }
    return y;
  }
};
long long sum1[26][2504];
long long sum2[26][2504];
std::vector<int> x(52);
void dfs(int i, int size, int offset, int tot, int cnt) {
  if (i == size) {
    if (tot > 2500) return;
    if (offset == 0)
      sum1[cnt][tot]++;
    else
      sum2[cnt][tot]++;
    return;
  }
  dfs(i + 1, size, offset, tot + x[i + offset], cnt + 1);
  dfs(i + 1, size, offset, tot, cnt);
  return;
}
int main() {
  int N, A;
  scanf("%d", &N);
  scanf("%d", &A);
  for (int i = 0; i < N; i++) {
    scanf("%d", &x[i]);
  }
  int half1 = N / 2;
  dfs(0, half1, 0, 0, 0);
  int half2 = N - half1;
  dfs(0, half2, half1, 0, 0);
  long long ans = 0;
  for (int c1 = 0; c1 <= half1; c1++) {
    for (int j = 0; j <= 2500; j++) {
      for (int c2 = 0; c2 <= half2; c2++) {
        int total = (c1 + c2) * A;
        if (c1 + c2 == 0) continue;
        if (total > 2500) continue;
        ans += sum1[c1][j] * sum2[c2][total - j];
      }
    }
  }
  std::cout << ans << std::endl;
  return 0;
}
