#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 69;
int a[N], n, x;
int main() {
  cin >> n >> x;
  unordered_map<int, int> ump;
  for (int i = 0; i < n; i++) {
    cin >> a[i], ++ump[a[i]];
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    ans += ump[x ^ a[i]];
    if ((x ^ a[i]) == a[i]) {
      --ans;
    }
  }
  cout << ans / 2 << '\n';
}
