#include <bits/stdc++.h>
using namespace std;
long long s, c, i, k, j, n, m, z, b;
long long t, cas, d, i1, a, i2, r, w;
long long ta[1000000];
vector<pair<int, int> > vk2;
string we1, we2, we;
vector<long long> vz, vk, va;
map<string, long long> mp;
map<string, long long>::iterator it;
int main() {
  cin >> n >> b;
  vk.assign(100002, 0);
  va.assign(100002, 0);
  k = 0;
  for (i = 0; i < n; i++) {
    cin >> a;
    vk[a]++;
    k = max(k, a);
  }
  z = 0;
  if (b > 0) {
    for (i = 1; i <= k; i++) {
      d = i ^ b;
      if (d <= k) z += vk[i] * vk[d];
    }
  } else {
    for (i = 1; i <= k; i++) {
      z += (vk[i] * (vk[i] - 1)) / 2;
    }
    z *= 2;
  }
  cout << z / 2 << endl;
  return 0;
}
