#include #define rep(i,n) for(int i = 0; i < (int)(n); i++) #define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--) #define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++) #define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++) #define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++) #define ALL(x) x.begin(), x.end() using ll = long long; using namespace std; int main(){ unsigned int n, x; cin >> n >> x; map mp; map fl; rep(i, n){ unsigned int in; cin >> in; mp[in]++; fl[in] = false; } ll ans = 0; for(auto p : mp){ if(fl[p.first] == true) continue; unsigned int nx = p.first ^ x; if(mp.count(nx) == 1){ ans += (ll)p.second * (ll)mp[nx]; fl[nx] = true; } } cout << ans << endl; return 0; }