#include <bits/stdc++.h>
using namespace std;
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6) {
    if (n % i == 0 || n % (i + 2) == 0) return false;
  }
  return true;
}
long long po(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
bool sec(const pair<long long, char> &a, const pair<long long, char> &b) {
  if (a.first == b.first) return a.second > b.second;
  return a.first > b.first;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  ;
  map<long long, long long> vis, fr;
  long long n, i, x, an = 0;
  cin >> n >> x;
  long long a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    fr[a[i]]++;
  }
  for (i = 0; i < n; i++) {
    if (!vis[a[i]]) {
      vis[a[i] ^ x] = 1, vis[a[i]] = 1;
      if (x == 0)
        an += (fr[a[i]] * (fr[a[i]] - 1)) / 2;
      else
        an += fr[a[i] ^ x] * fr[a[i]];
    }
  }
  cout << an;
}
