#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)1 << 31;
const long long MAXN = 100000;
int bs(vector<int> &v, int a) {
  int l = 0;
  int r = v.size() - 1;
  if (v[l] == a) {
    return 0;
  } else if (v[r] < a) {
    return -1;
  } else {
    while (r - l > 1) {
      int m = (l + r) >> 1;
      if (v[m] < a) {
        l = m;
      } else {
        r = m;
      }
    }
    if (v[r] == a) {
      return r;
    } else {
      return -1;
    }
  }
}
int main() {
  int n, x;
  cin >> n >> x;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  long long ans = 1;
  for (int i = 0; i < n; i++) {
    ans += upper_bound(v.begin(), v.end(), x ^ v[i]) -
           lower_bound(v.begin(), v.end(), x ^ v[i]);
    if (x == 0) {
      --ans;
    }
  }
  cout << ans / 2;
  return 0;
}
