#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
const int INF = 0x3f3f3f3f;
int Hash[maxn];
int main() {
  long long n, x, num, ans = 0;
  cin >> n >> x;
  while (n--) {
    cin >> num;
    ans += Hash[num ^ x];
    Hash[num]++;
  }
  cout << ans << endl;
  return 0;
}
