#include <bits/stdc++.h>
int a[100100];
int freq[100100];
int main(void) {
  int n, x;
  scanf("%d %d", &n, &x);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  long long ans = 0;
  for (int i = n; i >= 1; i--) {
    int req = x ^ a[i];
    if (req < 100100) ans += freq[req];
    freq[a[i]]++;
  }
  std::cout << ans << std::endl;
}
