#include using namespace std; int main() { int n, x; cin >> n >> x; map mp; for(int i = 0; i < n; ++i) { int a; cin >> a; ++mp[a]; } int64_t ans = 0; for(auto& e : mp) { int nxt = e.first ^ x; if(nxt < e.first) continue; if(nxt == e.first) { ans += e.second * (e.second + 1) / 2; } else { ans += e.second * mp[nxt]; } } cout << ans << '\n'; return 0; }