// #pragma GCC optimize("O3,unroll-loops") #include // #include using namespace std; #if __cplusplus >= 202002L using namespace numbers; #endif int main(){ cin.tie(0)->sync_with_stdio(0); cin.exceptions(ios::badbit | ios::failbit); int n; cin >> n; vector a(n); copy_n(istream_iterator(cin), n, a.begin()); if(accumulate(a.begin(), a.end(), 0, bit_xor<>()) != 0){ cout << "No\n"; return 0; } vector pref(n), found(10001); found[0] = true; for(auto i = 0; i < n - 1; ++ i){ pref[i + 1] = pref[i] ^ a[i]; if(found[pref[i + 1]]){ cout << "Yes\n"; return 0; } found[pref[i + 1]] = true; } vector dp(10001); for(auto i = 0; i < n - 1; ++ i){ for(auto x = 0; x <= 10000; ++ x){ if(dp[x]){ dp[x ^ a[i]] = true; } } dp[a[i]] = true; if(dp[0]){ cout << "Yes\n"; return 0; } } cout << "No\n"; return 0; } /* */