#include <bits/stdc++.h>
const int MAXN = 1e5;
const int INF = 1e9 + 10;
const int mod = 1e9;
using namespace std;
int main() {
  map<int, long long> mp;
  long long n, x, cnt = 0, a;
  cin >> n >> x;
  for (int i = 0; i < n; i++) {
    cin >> a;
    cnt += mp[(a ^ x)];
    mp[a]++;
  }
  cout << cnt << endl;
  return 0;
}
