#include <bits/stdc++.h>
using namespace std;
long long n, x, ar[100001], ans = 0;
int main() {
  cin >> n >> x;
  for (int i = 1; i <= n; i++) {
    int tem;
    cin >> tem;
    ar[tem]++;
  }
  for (int i = 1; i < 100001; i++) {
    int t = x ^ i;
    if (i == t)
      ans += ar[i] * (ar[i] - 1);
    else if (t < 100001)
      ans += ar[i] * ar[t];
  }
  cout << ans / 2 << endl;
  return 0;
}
