#include using namespace std; using ll = long long; template using Pa = pair; template using vec = vector; template using vvec = vector>; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N,X; cin >> N >> X; ll ans = 0; map mp; for(int i=0;i> a; ans += mp[X^a]; mp[a]++; } cout << ans << "\n"; }