#include <bits/stdc++.h>
using namespace std;
const int MAX = (int)1e5 + 77;
long long n, x, a[MAX], sum = 0;
bool used[MAX];
map<int, int> m;
set<int> s;
int main() {
  cin >> n >> x;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    ++m[a[i]];
  }
  for (int i = 1; i <= n; ++i) {
    sum += m[x ^ a[i]];
    if (x == 0) sum -= 1;
  }
  cout << sum / 2;
}
