#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, x;
  cin >> n >> x;
  long long arr;
  map<long long, int> freq;
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    cin >> arr;
    long long need = x ^ arr;
    ans += freq[need];
    ++freq[arr];
  }
  cout << ans << endl;
  return 0;
}
