#include #define filein(str) freopen(str, "r", stdin) #define fileout(str) freopen(str, "w", stdout); using namespace std; int nums[1000005]; map s; int main() { ios::sync_with_stdio(false); cin.tie(NULL); filein("xor.in"); fileout("xor.out"); int n, k; long long ans = 0; cin >> n >> k; for(int i = 0; i < n; i++) { cin >> nums[i]; ans += s[nums[i] ^ k]; s[nums[i]]++; } cout << ans << endl; return 0; }