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