#include <bits/stdc++.h>
using ll = long long;
using graph = std::vector<std::vector<ll>>;
using namespace std;
ll memo[52][52][2505];
void init() {
  for (int yi = 0; yi < 52; ++yi) {
    for (int xi = 0; xi < 52; ++xi) {
      for (int zi = 0; zi < 2505; ++zi) {
        memo[yi][xi][zi] = 0;
      }
    }
  }
}
int main() {
  int N, A;
  cin >> N >> A;
  int x[N];
  for (int i = 0; i < N; ++i) {
    cin >> x[i];
  }
  memo[0][0][0] = 1;
  memo[0][1][x[0]] = 1;
  for (int ni = 1; ni < N; ++ni) {
    for (int ci = 0; ci < 51; ci++) {
      for (int xi = 0; xi < 2505; xi++) {
        memo[ni][ci][xi] += memo[ni - 1][ci][xi];
        memo[ni][ci + 1][xi + x[ni]] += memo[ni - 1][ci][xi];
      }
    }
  }
  ll sum = 0;
  for (int ci = 1; ci < N; ci++) {
    for (int xi = 0; xi <= 2505; xi++) {
      if (ci * A == xi) {
        sum += memo[N - 1][ci][xi];
      }
    }
  }
  cout << sum << endl;
}
