#include #include #include #include #include #include #include using namespace std; typedef long long ll; int N, X; ll ans; map mp; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << setprecision(10) << fixed; cin >> N >> X; for(int i = 0; i < N; i++){ int a; cin >> a; if(mp.count(a) == 0){ mp[a] = 1; }else{ mp[a]++; } } for(auto i : mp){ int a = i.first; ll c = i.second; ans += c*mp[a^X]; } cout << ans/2 << endl; }