#include using namespace std; template typename enable_if::value, Ostream&>::type operator<<(Ostream& os, const Cont& v){ os << "[ "; for(auto &x : v) os << x << ' '; return os << "]"; } template Ostream& operator << (Ostream &os, const pair &p){ return os << "{" << p.first << ", " << p.second << "}"; } void dbg_cerr() { cerr << "\e[0m\n"; } template void dbg_cerr(Head H, Tail... T) { cerr << ' ' << H; dbg_cerr(T...); } #ifdef LTF #define DEBUG(...) cerr << "\e[1;31m[" #__VA_ARGS__ "]:", dbg_cerr(__VA_ARGS__) #else #define DEBUG(...) #endif constexpr int kC = 15; void Solve() { int N; cin >> N; vector a(N); int xor_sum = 0; for (auto &x : a) cin >> x, xor_sum ^= x; if (xor_sum != 0) { cout << "No\n"; return; } array basis{}; int rk = 0; auto add = [&](int x) { for (int i = kC - 1; i >= 0; i--) if (x >> i & 1) { if (!basis[i]) { basis[i] = x; rk++; return; } x ^= basis[i]; } }; for (auto &x : a) add(x); if (rk >= N - 1) cout << "No\n"; else cout << "Yes\n"; } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int T = 1; // cin >> T; while (T--) { Solve(); } return 0; }