#include <bits/stdc++.h>
using namespace std;
vector<int> arr;
int freq[100005];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    freq[t]++;
    arr.push_back(t);
  }
  long long cnt = 0;
  for (int i = 0; i < n; i++) {
    long long d = arr[i] ^ k;
    if (d == arr[i]) cnt--;
    if (d > 1e5) continue;
    cnt += freq[d];
  }
  cout << cnt / 2 << endl;
}
