#include <bits/stdc++.h>
using namespace std;
const int N = 500500;
long long a[N], cnt[N], ans, pref[N];
int main() {
  srand(time(NULL));
  int n, x;
  cin >> n >> x;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    ans += cnt[(a[i] ^ x)];
    cnt[a[i]]++;
  }
  cout << ans;
  return 0;
}
