#include <bits/stdc++.h>
using namespace std;
long long res[1000010] = {0};
long long num[1000010];
int main() {
  long long n, nn, x, total = 0;
  cin >> n >> nn;
  for (long long i = 0; i < n; i++) {
    cin >> num[i];
    res[num[i]]++;
  }
  if (nn > 0)
    for (long long i = 0; i < n; i++) {
      x = num[i] ^ nn;
      if (res[x] > 0) total += res[x] * res[num[i]];
      res[x] = 0;
      res[num[i]] = 0;
    }
  else
    for (long long i = 0; i < n; i++) {
      if (res[num[i]] > 1) {
        x = res[num[i]];
        total += (x * (x - 1)) / 2;
        res[num[i]] = 0;
      }
    }
  cout << total << endl;
  return 0;
}
