#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 5;
int n, k, a[MAX];
map<int, int> freq;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    freq[k ^ a[i]]++;
  }
  long long sol = 0;
  for (int i = 1; i <= n; i++) {
    sol += freq[a[i]];
    if (k == 0) sol--;
  }
  printf("%lld\n", sol / 2);
  return 0;
}
