#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int main() {
  int cnt[N << 1], arr[N << 1];
  int n, x;
  cin >> n >> x;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
    cnt[arr[i]]++;
  }
  long long res = 0;
  for (int i = 0; i < n; ++i) {
    int t = arr[i] ^ x;
    if (t == arr[i])
      res += cnt[arr[i]] - 1;
    else
      res += cnt[t];
  }
  cout << res / 2;
  return 0;
}
