#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  long long n, x;
  cin >> n >> x;
  long long cnt = 0;
  map<long long, long long> mp;
  long long values[n];
  for (int i = 0; i < n; i++) cin >> values[i], mp[values[i]]++;
  for (int i = 0; i < n; i++) {
    long long var = values[i] ^ x;
    if (var < 1 || var > 100000) continue;
    mp[values[i]]--;
    if (mp[var] > 0) cnt += mp[var];
  }
  if (n == 1)
    cout << 0 << "\n";
  else
    cout << cnt << "\n";
  return 0;
}
