#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  cin >> n >> x;
  int a[100008];
  int hash[300000];
  for (int i = 0; i <= 262190; i++) {
    hash[i] = 0;
  }
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    hash[a[i]]++;
  }
  long long count = 0;
  int bc;
  for (int i = 0; i < n; i++) {
    bc = a[i];
    hash[bc]--;
    count += hash[bc ^ x];
  }
  cout << count;
  return 0;
}
