#include <bits/stdc++.h>
int main() {
  int n, x, d;
  long long c = 0;
  scanf("%d%d", &n, &x);
  long long a[100000 + 5];
  int j;
  int id[100000 + 5];
  memset(a, 0, sizeof(a));
  memset(id, -1, sizeof(id));
  for (j = 0; j < n; j++) {
    scanf("%d", &d);
    if (id[d] < 0) id[d] = j;
    if ((d ^ x) <= 100000 && id[d ^ x] < j && id[d ^ x] >= 0) c += a[d ^ x];
    a[d]++;
    id[d] = j;
  }
  printf("%lld\n", c);
  return 0;
}
