#include #include #include using namespace std; constexpr int iINF = 1'000'000'000; int main () { int N; cin >> N; vector A(N); for (int i = 0; i < N; i++) cin >> A[i]; // 全体のxorが0という必要条件 -> 最初にチェックしておけば片側の存在を示せばOK // ダブり -> 即OK bool ok = true; int XOR = 0; for (auto a : A) XOR ^= a; if (XOR != 0) ok = false; map mp; for (auto a : A) mp[a]++; const int MAX = 20000; vector possible(MAX + 1, iINF); bool first = true; for (auto v : mp) { if (v.second % 2 == 0) { cout << "Yes\n"; return 0; } if (first) { first = false; possible[v.first] = 1; continue; } for (int i = 0; i <= MAX; i++) { if (!possible[i] == iINF) continue; possible[i ^ v.first] = min(possible[i ^ v.first], possible[i] + 1); } } if (N <= possible[0]) ok = false; if (ok) { cout << "Yes\n"; } else { cout << "No\n"; } }