#include <bits/stdc++.h>
using namespace std;
int n, a[100001], x, c[200001];
long long rs;
int main() {
  cin >> n >> x;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    c[a[i]]++;
  }
  for (int i = 0; i < n; i++) {
    int y = x ^ a[i];
    if (y == a[i])
      rs += c[y] - 1;
    else
      rs += c[y];
  }
  cout << rs / 2;
  return 0;
}
