#include <bits/stdc++.h>
using namespace std;
ifstream in("input.txt");
ofstream out("output.txt");
int main() {
  vector<int> a;
  int n, x;
  cin >> n >> x;
  a.resize(100001);
  vector<int> b;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    a[t]++;
    b.push_back(t);
  }
  unsigned long long ans = 0;
  for (int i = 0; i < n; i++) {
    if ((b[i] ^ x) == b[i]) {
      ans += (a[b[i]] - 1);
    } else if ((b[i] ^ x) < 100001) {
      ans += a[b[i] ^ x];
    }
    a[b[i]]--;
  }
  cout << ans;
}
