#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 100;
int n, x;
int num[maxn];
int main() {
  ios::sync_with_stdio(false);
  while (scanf("%d%d", &n, &x) != EOF) {
    for (int i = 0; i < n; ++i) {
      scanf("%d", &num[i]);
    }
    sort(num, num + n);
    int *it1, *it2;
    long long ans = 0;
    for (int i = 0; i < n; ++i) {
      it1 = lower_bound(num, num + n, num[i] ^ x);
      it2 = upper_bound(num, num + n, num[i] ^ x);
      ans += it2 - it1;
      if (x == 0) {
        --ans;
      }
    }
    printf("%I64d\n", ans / 2);
  }
  return 0;
}
