#include <bits/stdc++.h>
using namespace std;
const int Max = 2e5 + 10;
int A[Max], B[Max];
int main() {
  long long n, x, a, Ans = 0, t = 0;
  cin >> n >> x;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    B[A[i]]++;
  }
  for (int i = 0; i < n; i++) {
    B[A[i]]--;
    int m = (A[i] ^ x);
    Ans += B[m];
  }
  cout << Ans;
  return 0;
}
