#include <bits/stdc++.h>
const long long int INF = 1e9;
using namespace std;
struct Point {
  int x, y;
};
bool vector_finder(std::vector<int> vec, int number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance(vec.begin(), itr);
  if (index != vec.size()) {
    return true;
  } else {
    return false;
  }
}
int main() {
  long long int N, A, x, sum = 0;
  cin >> N >> A;
  vector<long long int> X, Sum;
  X.push_back(-1);
  Sum.push_back(0);
  for (long long int i = 0; i < (long long int)(N); i++) {
    cin >> x;
    X.push_back(x);
    sum += x;
    Sum.push_back(sum);
  }
  long long int dp[N + 2][N + 2][sum + 2];
  for (long long int i = 0; i < (long long int)(N + 2); i++) {
    for (long long int j = 0; j < (long long int)(N + 2); j++) {
      for (long long int k = 0; k < (long long int)(sum + 2); k++) {
        dp[i][j][k] = 0;
      }
    }
  }
  for (long long int i = 0; i < (long long int)(N + 1); i++) {
    for (long long int j = 0; j < (long long int)(i + 1); j++) {
      for (long long int k = 0; k < (long long int)(Sum[i] + 1); k++) {
        if (i == 0 && j == 0 && k == 0)
          dp[i][j][k] = 1;
        else if (i >= 1 && j >= 1 && k >= X[i]) {
          dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - X[i]];
        } else if (i >= 1 && k < X[i]) {
          dp[i][j][k] = dp[i - 1][j][k];
        }
      }
    }
  }
  long long int cnt = 0;
  for (long long int i = 1; i <= (long long int)(sum / A); i++) {
    cnt += dp[N][i][A * i];
  }
  cout << cnt << endl;
  return 0;
}
