#include using namespace std; using ll = long long; const ll LOG = 19; ll all[1<>n>>x; vector as(n); for(ll &a:as) cin>>a; ll ans=0; for(ll i=0;i>i)&1) continue; auto f=[&](ll a){return (a>>i)<>j)&1; ll y=(x>>(i+1))<<(i+1); for(ll j=0;j>j)&1) ans+=(all[y^f(a)]-(y==0))*(1<>j)&1))*(1<