#include <bits/stdc++.h>
using namespace std;
long long comb[60][60];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, a;
  cin >> n >> a;
  vector<int> x(n);
  for (int i = 0; i < n; ++i) {
    cin >> x[i];
    x[i] -= a;
  }
  sort(x.begin(), x.end());
  comb[0][0] = 1;
  for (int i = 1; i <= n; ++i) {
    comb[i][0] = comb[i][i] = 1;
  }
  for (int i = 1; i < n; ++i) {
    for (int j = 1; j <= i; ++j) {
      comb[i + 1][j] = comb[i][j - 1] + comb[i][j];
    }
  }
  long long res = 1;
  int cnt =
      upper_bound(x.begin(), x.end(), 0) - lower_bound(x.begin(), x.end(), 0);
  long long way = 0;
  for (int i = 0; i <= cnt; ++i) {
    way += comb[cnt][i];
  }
  res *= way;
  for (int num = 1; num <= x[n - 1]; ++num) {
    int cnt1;
    int cnt2;
    cnt1 = upper_bound(x.begin(), x.end(), num) -
           lower_bound(x.begin(), x.end(), num);
    cnt2 = upper_bound(x.begin(), x.end(), -num) -
           lower_bound(x.begin(), x.end(), -num);
    int limit = min(cnt1, cnt2);
    way = 0;
    for (int i = 0; i <= limit; ++i) {
      way += comb[cnt1][i] * comb[cnt2][i];
    }
    res *= way;
  }
  cout << res - 1 << endl;
}
