#pragma GCC target("avx2") #pragma GCC optimize("Ofast,unroll-loops") #include #define rep(i, n) for (int i = 0; i < n; i++) #define per(i, n) for (int i = n - 1; i >= 0; i--) #define ALL(a) a.begin(), a.end() using namespace std; #if __has_include() #include using mint = atcoder::modint998244353; istream &operator>>(istream &is, mint &a) { int t; is >> t; a = t; return is; } ostream &operator<<(ostream &os, mint a) { return os << a.val(); } #endif typedef long double ldouble; #undef long #define long long long #define vec vector template ostream &operator<<(ostream &os, vector &a) { const int n = a.size(); rep(i, n) { os << a[i]; if (i + 1 != n) os << " "; } return os; } template ostream &operator<<(ostream &os, array &a) { rep(i, n) os << a[i] << " \n"[i + 1 == n]; return os; } template istream &operator>>(istream &is, vector &a) { for (T &i : a) is >> i; return is; } template bool chmin(T &x, S y) { if (x > (T)y) { x = (T)y; return true; } return false; } template bool chmax(T &x, S y) { if (x < (T)y) { x = (T)y; return true; } return false; } template void operator++(vector &a) { for (T &i : a) ++i; } template void operator--(vector &a) { for (T &i : a) --i; } template void operator++(vector &a, int) { for (T &i : a) i++; } template void operator--(vector &a, int) { for (T &i : a) i--; } #undef endl #define endl '\n' void solve() { int n; cin >> n; vec a(n - 1); cin >> a; int x = 0; for (int i : a) x ^= i; int y; cin >> y; if (x != y) { cout << "No" << endl; return; } constexpr int inf = 1 << 13; vec d(inf); d[0] = true; for (int i : a) { if (d[i]) { cout << "Yes" << endl; return; } rep(j, inf) if (d[j]) d[j ^ i] = 1; } cout << "No" << endl; } int main() { // srand((unsigned)time(NULL)); cin.tie(nullptr); ios::sync_with_stdio(false); // cout << fixed << setprecision(40); int t = 1; // cin >> t; while (t--) solve(); return 0; }