#include #define endl '\n' using namespace std; template inline void chkmax(T &x, const T1 &y) { if (x < y) x = y; } template inline void chkmin(T &x, const T1 &y) { if (x > y) x = y; } const string TASK_NAME = "xor"; const bool DEBUG = false; int n, k; long long a[100000]; map m; void read() { cin >> n >> k; for (int i = 0; i < n; i++) { cin >> a[i]; if (m.count(a[i]) == 0) m[a[i]] = 1; else m[a[i]]++; } } void solve() { long long ans = 0ll; for (int i = 0; i < n; i++) { m[a[i]]--; int next = a[i] ^ k; if (m.count(next) > 0) ans += m[next]; } cout << ans << endl; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); if (!DEBUG) { freopen((TASK_NAME + ".in").c_str(), "rt", stdin); freopen((TASK_NAME + ".out").c_str(), "wt", stdout); } m.clear(); read(); solve(); return EXIT_SUCCESS; }