#include <bits/stdc++.h>
using namespace std;
using LL = long long;
const LL inf = 1LL << 60;
int num[100000 + 5] = {0};
vector<vector<int>> vv(200000 + 5);
int main() {
  int n, x;
  scanf("%d%d", &n, &x);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &num[i]);
    vv[num[i]].push_back(i);
  }
  LL ans = 0;
  for (int i = 0; i < n; ++i) {
    int ot = num[i] ^ x;
    LL l = vv[ot].end() - lower_bound(vv[ot].begin(), vv[ot].end(), i);
    if (ot == num[i]) --l;
    ans += l;
  }
  printf("%lld\n", ans);
}
