#include <bits/stdc++.h>
using namespace std;
const int INF = 2000000000;
const int MAX = 10000000;
int main() {
  ios_base::sync_with_stdio(0);
  int n, x;
  while (cin >> n >> x) {
    int arr[n];
    map<int, long long> m;
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
      m[arr[i]]++;
    }
    long long cnt = 0;
    for (int i = 0; i < n; i++) {
      int tmp = arr[i] ^ x;
      if (m[tmp]) cnt += m[tmp];
      if (tmp == arr[i]) cnt--;
    }
    cout << cnt / 2ll << "\n";
  }
  return 0;
}
