#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, k;
  cin >> n >> k;
  map<long long, long long> mp;
  vector<long long> v;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    v.push_back(x);
  }
  long long ans = 0;
  for (auto x : v) {
    ans += mp[x ^ k];
    mp[x]++;
  }
  cout << ans << endl;
}
