#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
int book[maxn], n, x, t;
int main() {
  scanf("%d%d", &n, &x);
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &t);
    ans += book[t ^ x];
    book[t]++;
  }
  printf("%I64d\n", ans);
  return 0;
}
