#include <bits/stdc++.h>
using namespace std;
long long dx[] = {1, 0, -1, 0};
long long dy[] = {0, 1, 0, -1};
bool compare(const pair<long long, long long> &a,
             const pair<long long, long long> &b) {
  if (a.first == b.first) {
    return (b.second < a.second);
  }
  return (a.first < b.first);
}
bool prime[10000001];
void SieveOfEratosthenes(long long n) {
  memset(prime, true, sizeof(prime));
  for (long long p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
}
string toBinary(long long n) {
  string r;
  while (n != 0) {
    r = (n % 2 == 0 ? "0" : "1") + r;
    n /= 2;
  }
  return r;
}
long long cn[100005] = {0};
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, b;
  cin >> n >> b;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long cnt = 0;
  for (long long i = 0; i < n; i++) {
    cn[a[i]]++;
  }
  for (long long i = 0; i < n; i++) {
    cn[a[i]]--;
    long long x = a[i];
    long long f = x ^ b;
    cnt += cn[f];
  }
  cout << cnt;
}
