#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool scan_d(T &ret) {
  char c;
  int sgn;
  if (c = getchar(), c == EOF) return 0;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1 : 1;
  ret = (c == '-') ? 0 : (c - '0');
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  ret *= sgn;
  return 1;
}
int n, x;
int a[100010];
long long c[100010];
long long ans;
void doing() {
  scan_d(n);
  scan_d(x);
  for (int i = 1; i <= n; i++) scan_d(a[i]);
  for (int i = 1; i <= n; i++) {
    int t = x ^ a[i];
    if (t <= 100000) ans += c[t];
    c[a[i]]++;
  }
  cout << ans << endl;
}
int main() {
  doing();
  return 0;
}
