#include <bits/stdc++.h>
using namespace std;
long long number[1000005];
int main() {
  long long n, x, i;
  cin >> n >> x;
  for (i = 0; i < n; i++) {
    cin >> number[i];
  }
  vector<long long> num(number, number + n);
  sort(num.begin(), num.end());
  vector<long long>::iterator it;
  long long sum = 0;
  for (it = num.begin(); it != num.end(); it++) {
    if (binary_search(it + 1, num.end(), (*it) ^ x))
      sum += upper_bound(it + 1, num.end(), (*it) ^ x) -
             lower_bound(it + 1, num.end(), (*it) ^ x);
  }
  cout << sum << endl;
  return 0;
}
