#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long i, n, x, aux, tab[100000 + 1], r = 0;
  for (i = 1; i <= 100000; i++) {
    tab[i] = 0;
  }
  cin >> n >> x;
  for (i = 1; i <= n; i++) {
    cin >> aux;
    tab[aux]++;
  }
  if (x == 0) {
    for (i = 1; i <= 100000; i++) {
      if (tab[i] > 1) {
        r += (tab[i] * (tab[i] - 1)) / 2;
      }
    }
  } else {
    for (i = 1; i <= 100000; i++) {
      if (tab[i] > 0) {
        aux = x ^ i;
        if (aux > i && aux <= 100000) r += tab[aux] * tab[i];
      }
    }
  }
  cout << r;
  return 0;
}
