#include <bits/stdc++.h>
using namespace std;
bool p[100002];
int e[100002];
int c[100002];
int main() {
  int n, x;
  cin >> n >> x;
  int a[n];
  long long count = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if ((a[i] ^ x) > 100001) {
      continue;
    }
    if (c[a[i] ^ x]) {
      count += c[a[i] ^ x];
    }
    c[a[i]]++;
  }
  cout << count << "\n";
}
