#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10, mod = 1e9 + 7, inf = 1e9 + 10;
long long arr[maxn];
long long out;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie();
  long long n, x, a;
  cin >> n >> x;
  for (long long i = 0; i < n; i++) {
    cin >> a;
    arr[a]++;
  }
  for (long long i = 1; i < maxn; i++) {
    if (!x)
      out += arr[i] * (arr[i] - 1);
    else if ((i ^ x) < maxn)
      out += arr[i] * arr[(i ^ x)];
  }
  cout << out / 2 << endl;
  return 0;
}
