#include <bits/stdc++.h>
using namespace std;
long long int const N = 1e6 + 50;
long long int arr[N], a[N];
signed main() {
  long long int n, x, ans = 0;
  cin >> n >> x;
  for (long long int i = 0; i < n; i++) cin >> a[i];
  for (long long int i = 0; i < n; i++) {
    ans += arr[a[i] ^ x];
    arr[a[i]]++;
  }
  cout << ans;
}
