#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, A;
  long long dp[501] = {};
  long long tp[501] = {};
  dp[250] = 1;
  cin >> n >> A;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    x -= A;
    for (int j = 0; j <= 500; ++j) {
      if (dp[j]) {
        tp[j] += dp[j];
        tp[j + x] += dp[j];
      }
    }
    for (int j = 0; j <= 500; ++j) {
      dp[j] = tp[j];
      tp[j] = 0;
    }
  }
  printf("%lld\n", dp[250] - 1);
  return 0;
}
