#include <bits/stdc++.h>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;

main() {
    int64_t n;
    cin >> n;

    if (n % 3 != 0) {
        cout << "No" << endl;
        return 0;
    }

    array<int64_t, 3> nums{-1, -1, -1};
    for (auto i : irange(0L, n)) {
        int64_t a;
        cin >> a;

        if (nums[i % 3] < 0) {
            nums[i % 3] = a;
            continue;
        } else if (nums[i % 3] != a) {
            cout << "No" << endl;
            return 0;
        }
    }

    if (nums[0] ^ nums[1] != nums[2]) {
        cout << "No" << endl;
        return 0;
    }

    cout << "Yes" << endl;
}