#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int main() {
  long long int n, num, ct = 0, a, val;
  n = read();
  num = read();
  int cnt[1000010];
  for (int i = 1; i <= n; i++) {
    val = read();
    a = val ^ num;
    ct += cnt[a];
    cnt[val]++;
  }
  cout << ct << endl;
  return 0;
}
