#include <bits/stdc++.h>
using namespace std;
int main(void) {
  map<int, int> m;
  int n, x;
  cin >> n >> x;
  int a[n];
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    m[a[i]]++;
  }
  if (x == 0) {
    for (auto u : m) ans += 1ll * (u.second - 1) * u.second / 2;
    cout << ans << "\n";
    return 0;
  }
  for (auto u : m) ans += 1ll * u.second * m[(u.first ^ x)];
  cout << ans / 2 << "\n";
  return 0;
}
