#include <bits/stdc++.h>
using namespace std;
long long arr[312345], ans, mx, n, k, a, b, t, cz, co, ct = -1, cp, c, d, dif;
string s;
int main() {
  cin >> a >> b;
  map<long long, long long> mp;
  for (int i = 0; i < a; i++) {
    cin >> arr[i];
    mp[arr[i]]++;
  }
  for (int i = 0; i < a; i++) {
    mp[arr[i]]--;
    ans += mp[arr[i] ^ b];
  }
  cout << ans;
  return 0;
}
