#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int N, X;
  cin >> N >> X;
  vector<int> freq(1e6);
  for (int i = 0; i < N; i++) {
    int ai;
    cin >> ai;
    freq[ai]++;
  }
  long long ans = 0;
  for (int i = 0; i < 1e6; i++) {
    if (freq[i] == 0 || (i ^ X) < i) continue;
    int j = i ^ X;
    if (i == j)
      ans += (long long)freq[i] * (freq[i] - 1) / 2;
    else
      ans += (long long)freq[i] * freq[j];
  }
  cout << ans << endl;
  return 0;
}
