#include <bits/stdc++.h>
using namespace std;
const int N = 55;
int x[N], a, n, y[N];
long long c[N][N];
int main() {
  for (int i = 1; i <= 50; ++i) {
    c[i][0] = c[i][i] = 1;
    for (int j = 1; j < i; ++j) c[i][j] = c[i - 1][j - 1] + c[i - 1][j];
  }
  scanf("%d%d", &n, &a);
  int cnt = 0;
  for (int i = 1; i <= n; ++i) {
    int t;
    scanf("%d", &t);
    if (t > a)
      ++x[t - a];
    else if (t == a)
      ++cnt;
    else
      ++y[a - t];
  }
  bool flag = 0;
  long long ret = 1;
  for (int i = 1; i <= 50; ++i) {
    long long tmp = 1;
    if (!x[i] || !y[i]) continue;
    for (int j = 1; j <= x[i] && j <= y[i]; ++j) {
      tmp += c[x[i]][j] * c[y[i]][j];
    }
    ret *= tmp;
  }
  long long tmp = 1;
  for (int i = 1; i <= cnt; ++i) tmp += c[cnt][i];
  ret = ret * tmp - 1;
  printf("%I64d\n", ret);
  return 0;
}
