#include <bits/stdc++.h>
using namespace std;
long long n, x, freq[100123], pairs = 0;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> n >> x;
  long long v[n];
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
    freq[v[i]]++;
  }
  for (long long i = 0; i < 100123; i++)
    if (freq[i] > 0)
      if ((x ^ i) < 100123) pairs += freq[i] * (freq[(x ^ i)] - ((x ^ i) == i));
  pairs /= 2;
  cout << pairs << endl;
  return 0;
}
