#pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include #include #include #include using namespace std; using i32 = int_fast32_t; using i64 = int_fast64_t; #define rep(i, n) for (i32 i = 0; i < (i32)(n); i++) #define all(a) (a).begin(),(a).end() #define rall(a) (a).rbegin(),(a).rend() using P = pair; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); i32 n,x; cin >> n >> x; vector a(n); set st; rep(i,n) { cin >> a[i]; st.insert(a[i]); } map mpa,mpb; rep(i,n){ mpa[a[i]]++; } i64 ans = 0; set st1; if(x == 0){ for(auto v:mpa){ ans += v.second * (v.second - 1) / 2; } }else{ for(auto v:mpa){ if(!st1.count(v.first) && !st1.count(v.first ^ x)) { ans += v.second * mpa[v.first ^ x]; st1.insert(v.first); st1.insert(v.first ^ x); } } } cout << ans << endl; }