#include <bits/stdc++.h>
int a[100005];
int c[100005];
int main() {
  int n, x;
  while (scanf("%d%d", &n, &x) != EOF) {
    int i;
    for (i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      c[a[i]]++;
    }
    int y;
    long long num = 0;
    for (i = 1; i <= n; i++) {
      y = a[i] ^ x;
      if (y == a[i])
        num += c[y] - 1;
      else if (y <= 100000)
        num += c[y];
    }
    printf("%lld\n", num / 2);
  }
  return 0;
}
