#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  int n, x, b;
  cin >> n >> x;
  vector<unsigned long long> a(2000001, 0);
  unsigned long long ans = 0;
  for (int i = 0; i < n; ++i) {
    cin >> b;
    ++a[b];
  }
  for (int i = 1; i <= 100000; ++i) {
    b = i ^ x;
    if (b > i)
      ans += a[i] * a[b];
    else if (b == i)
      ans += ((a[i] - 1) * a[i]) / 2;
  }
  cout << ans << endl;
  return 0;
}
