#include using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < (n); i++) #define P pair int main() { int n, x; cin >> n >> x; set s; map mp; rep(i,n) { int a; cin >> a; s.insert(a); mp[a]++; } ll ans = 0; if (x == 0) { for (auto it : mp) { ans += it.second * (it.second-1)/2; } cout << ans << endl; return 0; } for (int ax : s) { auto it = s.find(ax^x); if (it != s.end()) { ans += mp[ax]*mp[ax^x]; } } ans /= 2; cout << ans << endl; }