#include <bits/stdc++.h>
using namespace std;
int n, x, a[100005];
long long re;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> x;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    int t = a[i] ^ x;
    if (t >= a[i]) {
      int lwr = lower_bound(a + i + 1, a + n, t) - a;
      int upr = upper_bound(a + i + 1, a + n, t) - a;
      re += (upr - lwr);
    }
  }
  cout << re;
  return 0;
}
