#include <bits/stdc++.h>
using namespace std;
int n, ar[1000001], x, ars[1000001];
int main() {
  cin >> n >> x;
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
    ars[ar[i]]++;
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    ars[ar[i]]--;
    ans += (ars[(ar[i] ^ x)]);
  }
  cout << ans;
  return 0;
}
