#include <bits/stdc++.h>
using namespace std;
int n, x, a[11000000], tmp;
long long cnt = 0;
int main() {
  cin >> n >> x;
  memset(a, 0, sizeof(a));
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    cnt += a[tmp ^ x];
    a[tmp]++;
  }
  cout << cnt;
  return 0;
}
