#include <bits/stdc++.h>
using namespace std;
int a[100100];
int main() {
  int n, x;
  map<int, long long> mm;
  scanf("%d %d", &n, &x);
  long long solution = 0;
  for (int i = 0; i < int(n); i++) {
    scanf("%d", &a[i]);
    if (mm.count(a[i] ^ x)) solution += mm[a[i] ^ x];
    mm[a[i]]++;
  }
  printf("%lld\n", solution);
}
